PHP Testing Koans to understand how to write unit tests with PHPUnit.
This is a Composer project.
Additional exercises cover Hamcrest matchers.
Run composer install to install the required dependencies.
- Run tests with
phpunit(orvendor/bin/phpunit). - You should see some test failures and errors (but there are no assertions).
- Go through the test code starting from Session 1:
- All assertions are commented and incomplete.
- Uncomment the assertions and complete them making the tests pass.
- You can run individual sessions using
phpunit test/Session1_GreeterTest.php.