PHP TESTING WITH PHP UNIT TEST.
We will test the formatDate method and cover the usage of the PHPUnit Data providers and the TestCase PHPUnit Setup method.
This is a part of a series of 4 videos that will walk through how to effectively write unit tests and learn how to unit test your code using the PHP phpunit library.
Chapters:
0:00 Preparing our test class for unit test.
0:15 Importing and initializing the class method we want to unit test.
0:24 Unit test the method with a specific parameter.
0:28 Using the PHP unit test assert same method.
0:57 Run the PHP unit test to test the method.
1:03 Data provider use case in PHP unit test.
1:13 Data provider PHP unit test introduction.
1:17 Data provider usage in PHP unit test.
1:38 What should a Data provider function in php unit test returns.
2:03 Adjusting our unit test method to use the data provider.
2:22 Rerun our unit test but with dataProvider this time.
2:30 Multiple data points using dataProvider of the PHP unit test.
3:13 Setup method use case of the PHP unit test testCase class.
3:35 Overwriting and using the setup method of the PHP unit testCase class.
3:48 Rerun our PHP Unit test using the setup method and the data provider.