Ninja test is a self-sufficient unit test that is fully responsible for setting up environment it depends on and doesn't rely on other tests. Unlike others, ninja-tests survive within any test suite, they are less subjected to accidental false-negative failures and don't require periodical fixing.
In order to see if your newly written test passes the ninja qualification, to run it with the following command:
php phpunit.php --bootstrap=/path/to/ninja.php -c tests/phpunit.xml /path/to/test.php
When writing test, it may be easier just to copy the contents of ninja.php
and paste it into test setUp()
or setUpBeforeClass()
method.