Skip to main content

2 docs tagged with "php"

View All Tags

PHP

PHP on Codewars

PHPUnit

All PHPUnit tests start with a subclass of TestCase. You can then add one or more test case methods to that class, each of which must be public and start with test. In Codewars' PHP versions 7.4+, PHPUnit requires the name of the test class to end with Test. For the same versions, every PHP file (user code, tests, and preloaded if anything is in there) should have the opening tag <?php, and every test file should have the import use PHPUnit\Framework\TestCase;. The PHP runner will concatenate them if missing, but it is a legacy behavior that should not be relied on for new content.