Only shim expectException if necessary (#27)

* Only shim expectException if necessary

* Added missing entries to gitignore
This commit is contained in:
Justin Boswell
2021-06-08 09:56:32 -07:00
committed by GitHub
parent 7d47316a7d
commit d2546e616d
2 changed files with 8 additions and 3 deletions
+2
View File
@@ -197,3 +197,5 @@ Makefile*
/vendor/
.idea/
.DS_Store
composer.lock
PHP-Parser*/
+6 -3
View File
@@ -22,8 +22,11 @@ abstract class CrtTestCase extends PHPUnit_Framework_TestCase {
}
}
// shim expectException -> setExpectedException for PHPUnit 4.8.x
public function expectException($exceptionName) {
$this->setExpectedException($exceptionName);
// Shim missing calls in older versions of PHPUnit
public function __call($name, $arguments) {
// shim expectException -> setExpectedException for PHPUnit 4.8.x
if ($name == 'expectException') {
$this->setExpectedException($arguments[0]);
}
}
}