From d2546e616dd9f044b6dba9b063ad73140c0bf63e Mon Sep 17 00:00:00 2001 From: Justin Boswell Date: Tue, 8 Jun 2021 09:56:32 -0700 Subject: [PATCH] Only shim expectException if necessary (#27) * Only shim expectException if necessary * Added missing entries to gitignore --- .gitignore | 2 ++ tests/common.inc | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a4fe3b7..19ad2fe 100644 --- a/.gitignore +++ b/.gitignore @@ -197,3 +197,5 @@ Makefile* /vendor/ .idea/ .DS_Store +composer.lock +PHP-Parser*/ diff --git a/tests/common.inc b/tests/common.inc index 0cb443a..db1e199 100644 --- a/tests/common.inc +++ b/tests/common.inc @@ -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]); + } } }