How to detect version of PHPUnit
You can get version using PHPUnit_Runner_Version
class: https://github.com/sebastianbergmann/phpunit/blob/3.5/PHPUnit/Runner/Version.php
And based on that - halt your tests execution or do whatever you want.
Works on mac:
phpunit --version
@Marc B
To make the test incomplete for older versions:
if (
!method_exists('PHPUnit_Runner_Version','id')
|| version_compare(PHPUnit_Runner_Version::id(), '3.7', '<=')
) {
$this->markTestIncomplete('need phpunit >= 3.7 to run this test');
}