programmer and a bad programmer is that the good programer uses tests to detect his mistakes as soon as possible...” -- phpunit manual 3 Friday, March 30, 12
install PHPUnit under YourProject/vendor/ directory Then use the installed phpunit.php executable Then simply do: composer.phar install/update to install/update dependencies 12 Friday, March 30, 12
“testeable”: Wrap $_ superglobals in more semantic objects suchas request and response Bootstrap test file is a mess due to all those F*** super global constants: DON’T USE CONSTANTS OR SINGLETONS, USE DEPENDENCY INJECTION Setup a test database (easy but don’t forget to use MyISAM as the database engine) We had to refactor the codebase in order to: 16 Friday, March 30, 12
when I’m testing: tests/AddBuyer/Tests/RegistrationTest.php I load the fixture: tests/AddBuyer/Fixtures/RegistrationTest.yml test case fixture 21 Friday, March 30, 12