The complete guide to PHP testing

I want to hit the like button for every test passed. Thanks, the best tutorial on this subject.

Start
  1. Courses
  2. The complete guide to PHP testing

WHAT'S COVERED IN THIS COURSE?

There's a lot of material out there that shows you HOW to write basic tests that cover basic scenarios. Assert that string 'foo' does not equal 'bar'? No problem! But how do you know WHAT to test, in what order, and WHERE to start? How do you know that your code has sufficient test coverage? Is some code impossible to test? What would YOU do if it was?

SIMPLE EXAMPLES ARE FINE FOR LEARNING THE BASICS OF TESTING BUT THEY ARE NOT GOING TO TEACH YOU HOW TO TEST REAL APPLICATIONS...

I'm sorry but there's a lot more to it...The good news is that THE ANSWERS ARE ALL CONTAINED WITHIN THIS COURSE...keep reading.

Section: Getting Started With PHPUnit

1. Course Introduction (1:22)
2. Installing PHPUnit (2:31)
3. Write your first test (8:30)
4. Testing functions (4:53)
5. Testing class methods (7:15)
6. Command line options (6:36)
7. Filtering tests (2:10)
8. Errors vs failures (4:34)
9. Autoloading (5:46)
10. Next steps (0:29)

Section: PHPUnit Workflow and Configuration

11. The setUp method (5:09)
12. The tearDown method (4:23)
13. Using tests to refactor (2:59)
14. Using Assertions (14:22)
15. Write Your Own Failure Message (2:21)
16. Configure PHPUnit Using phpunit.xml (15:13)
17. Testing errors and exceptions (14:02)
18. Data providers (6:41)

Section: Testing Strategies Part One (Unit Testing)

19. Testing strategies introduction (4:19)
20. Create a Twitter developers account (3:03)
21. The project files (10:13)
22. Create the database table (4:06)
23. The test plan (1:17)
24. Risky tests and incomplete tests (4:11)
25. Mocking (14:10)
26. Refactoring for easier testing (5:35)
27. Mocking static methods (7:16)
28. Test new followers per week (8:01)
29. Testing all logic paths (3:11)
30. Should you replace static methods? (2:34)
31. Tidy up unit testing loose ends (2:57)

Section: Testing Strategies Part Two (Integration Testing)

32. Introduction to integration testing (3:02)
33. When not to mock (3:28)
34. Testing API integration (12:37)
35. Grouping tests using @group (4:01)
36. Testing An Authentication Exception (8:53)
37. Intro to testing against a database (3:34)
38. Create a test database connection (2:59)
39. Create a Schema Tool (2:33)
40. Create A Database Dependant Test Case (6:13)
41. Testing ordered database records (10:11)
42. Testing null database returns (4:12)
43. Test saving to the database (11:36)
44. Create a database test assertion (4:30)
45. Flatten an array (6:55)
46. Flatten the Twitter Data (3:09)

Section: Testing Strategies Part Three (Feature / Functional Testing)

47. Introduction to feature testing (2:49)
48. Feature test setup (14:01)
49. Feature test assertions (7:05)
50. Running the feature tests (5:51)

Section: Testing HTTP Request -> Response

51. Testing HTTP Request / Response Introduction (0:54)
52. Laravel Test Setup (5:11)
53. Asserting Against Response Content (6:38)
54. Testing Authenticated Endpoints (5:25)
55. Create a Post Model (8:06)
56. Full Request -> Response Test (6:12)

Section: Test Doubles

57. PHPUnit Test Doubles (8:02)
58. Testing expectations (3:30)
59. Faking method return values (4:53)
60. Testing consecutive returns (4:01)
61. Throwing exceptions from stubbed methods (2:38)
62. Will return callback (4:13)
63. Test faked methods receive correct arguments (6:10)
64. Test faked methods receive correct arguments using callbacks (6:21)
65. The mock builder (10:36)

Section: Test Coverage

66. Test coverage introduction (2:07)
67. Test coverage setup (6:21)
68. HTML Format coverage report (4:16)
69. Maximising test coverage (7:01)

Section: Test Driven Development

70. Introduction (4:11)
71. Setup (2:17)
72. TDD baby steps (12:46)
73. Red > Green > Clean (4:51)
74. Value objects (4:14)
75. Privacy (3:53)
76. Dollar objects (2:55)
77. Common equals (6:09)
78. Apples and oranges (3:34)
79. Eliminating duplicate classes (7:03)
80. Simple currency (11:38)
81. Ask the computer (11:02)
82. A BIG clean up (0:01)
83. Simple addition (13:16)
84. A sum of moneys (6:32)
85. Make it (12:03)
86. Adding mixed currencies (5:37)
87. The extra mile (5:05)
88. Multiplying sums (4:18)
89. Let's go crazy (2:49)
90. Retrospective (6:47)

Section: Applying TDD to our Testing Strategies Project

91. Using tests to switch libraries (19:02)
92. Switching libraries (3:58)

Course Instructor

Image

Gary Clarke

Hello and thank you so much for checking out my work. My name is Gary Clarke and I'm a software developer with many years experience, primarily in PHP. I started creating video tutorials during lockdown in 2020 because I wanted the challenge of being able to explain complex / technical subjects to others in a way which is easy to undertsand and remember.

At this moment in time, my videos have been watched nearly half a million times and I intend to keep creating new and improved content and teaching more and more new people. It would be my pleasure to see you on the inside of one of my courses.