Keep in mind that PHPT files have to be parsed in userland. The runner has to pull out the --TEST-- section from each file, write it to a temp file and then execute the temp file in a separate PHP process. It's actually an incredibly slow way to test your code. I have test suites where thousands of PHPUnit tests execute an order of magnitude faster than dozens of PHPT files.
> "Oh yeah it has all the latest assertions, like you can assert XML using CSS selectors".
The value of PHPUnit isn't really the assertions. It's true that most of the assertions can be replaced with a single line of code. The main exception is assertEquals which requires some special consideration for recursive objects, canonicalization, floating points, etc.
The biggest selling point for my team is the ecosystem. PHPUnit integrates with a number of IDEs, continuous integration platforms, ticketing systems, profiling tools, code coverage tools, code quality tools, etc.
> How tests run, well, in a nutshell:
> foreach (glob('/tests/*' as $test)) exec('php ' . $test);
This fails your own litmus test. The PHPT runner that ships with PHP is actually thousands of lines long: https://github.com/php/php-src/blob/7b7d2952a606fba6a5e21998...
Keep in mind that PHPT files have to be parsed in userland. The runner has to pull out the --TEST-- section from each file, write it to a temp file and then execute the temp file in a separate PHP process. It's actually an incredibly slow way to test your code. I have test suites where thousands of PHPUnit tests execute an order of magnitude faster than dozens of PHPT files.
> "Oh yeah it has all the latest assertions, like you can assert XML using CSS selectors".
The value of PHPUnit isn't really the assertions. It's true that most of the assertions can be replaced with a single line of code. The main exception is assertEquals which requires some special consideration for recursive objects, canonicalization, floating points, etc.
The biggest selling point for my team is the ecosystem. PHPUnit integrates with a number of IDEs, continuous integration platforms, ticketing systems, profiling tools, code coverage tools, code quality tools, etc.