Section 1 : Introduction and project setup
|
Lecture 1 | INTRODUCTION TO BRAINMEASURES PROCTOR SYSTEM | |
|
Lecture 2 | Install PHP and Composer (Windows) | |
|
Lecture 3 | Install PHP and Composer (macOS) | 00:01:40 Duration |
|
Lecture 4 | Install PHP and Composer (Linux) | 00:01:31 Duration |
|
Lecture 5 | Create a project folder and install PHPUnit | 00:01:58 Duration |
Section 2 : Unit testing with PHPUnit the basics
|
Lecture 1 | Write and run your first test an introduction to assertions | 00:04:16 Duration |
|
Lecture 2 | Test a function using multiple assertions | 00:03:00 Duration |
|
Lecture 3 | Test that incorrect results are not returned using multiple test methods | 00:02:45 Duration |
|
Lecture 4 | Test a class fixing bugs through testing | 00:04:30 Duration |
|
Lecture 5 | How to name your test methods | 00:03:05 Duration |
Section 3 : Configuring the PHPUnit test environment
|
Lecture 1 | The PHPUnit test runner specify different options when running tests | 00:03:03 Duration |
|
Lecture 2 | Configure PHPUnit the XML configuration file | 00:04:05 Duration |
|
Lecture 3 | Autoload classes being tested using Composer | 00:03:58 Duration |
Section 4 : Test dependencies, fixtures and exceptions
|
Lecture 1 | Unit test a queue class | 00:04:16 Duration |
|
Lecture 2 | Test dependencies make one test method dependent on another | 00:03:03 Duration |
|
Lecture 3 | Fixtures set up the known state of the tests using setUp and tearDown | 00:04:38 Duration |
|
Lecture 4 | Easily add a new test method using the test fixture | 00:02:07 Duration |
|
Lecture 5 | Share fixtures between tests for resource-intensive data | 00:04:08 Duration |
|
Lecture 6 | Testing exceptions expecting code to throw an exception | 00:04:10 Duration |
Section 5 : Test doubles mocks and stubs
|
Lecture 1 | Test doubles create mock objects to remove dependencies on external resources | 00:05:35 Duration |
|
Lecture 2 | Dependency injection inject objects that a class depends on | |
|
Lecture 3 | Test object interactions verify how a dependency is used | 00:04:47 Duration |
|
Lecture 4 | Customise the creation of the mock object the getMockBuilder method | 00:05:22 Duration |
Section 6 : Mockery - an alternative mocking framework with a human-readable syntax
|
Lecture 1 | Mock a dependency that doesn't exist yet | 00:04:11 Duration |
|
Lecture 2 | Using Mockery installation and integration with PHPUnit | 00:02:22 Duration |
|
Lecture 3 | Using Mockery to mock a dependency that doesn't exist yet | 00:03:38 Duration |
|
Lecture 4 | PHPUnit vs Mockery Returning different values on subsequent method calls | 00:05:47 Duration |
|
Lecture 5 | Mockery Spies Make assertions on a call after the event | 00:04:37 Duration |
Section 7 : Test-driven development
|
Lecture 1 | Test-driven development set up a TDD project | 00:03:10 Duration |
|
Lecture 2 | Write the test first, then write the code to make it pass | 00:03:16 Duration |
|
Lecture 3 | Write just enough code to make the test pass | |
|
Lecture 4 | Add tests and refactor code until the tests pass | 00:03:15 Duration |
|
Lecture 5 | Add more tests and application code functionality | |
|
Lecture 6 | Another test, more functionality, and more refactoring | 00:02:55 Duration |
|
Lecture 7 | Data providers provide a test method with a collection of data | 00:05:50 Duration |
Section 8 : Testing non-public methods and properties and abstract classes
|
Lecture 1 | Testing non-public methods | 00:03:09 Duration |
|
Lecture 2 | Testing protected methods using inheritance | 00:03:17 Duration |
|
Lecture 3 | Testing private methods using reflection | 00:02:23 Duration |
|
Lecture 4 | Testing private methods with arguments using reflection | 00:02:44 Duration |
|
Lecture 5 | Testing protected and private attributes | 00:01:56 Duration |
|
Lecture 6 | Testing abstract classes | 00:04:48 Duration |
Section 9 : Testing static methods
|
Lecture 1 | Testing static methods | 00:02:53 Duration |
|
Lecture 2 | The problem with static methods dependencies and mocking | 00:04:07 Duration |
|
Lecture 3 | Option 1 Refactor code to remove the static method | |
|
Lecture 4 | Option 2 Pass the dependency as a callable | 00:04:29 Duration |
|
Lecture 5 | Option 3 Use Mockery alias mocks to stub the static method call | 00:02:37 Duration |