From a8922fdfdb1b485d866efc3d4463b1f4ce13d5fd Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 25 Sep 2018 22:52:22 +0530 Subject: [PATCH] Fix test for phpunit 5.7. --- tests/TestCase/Controller/ControllerTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/TestCase/Controller/ControllerTest.php b/tests/TestCase/Controller/ControllerTest.php index 2c76845a065..dca8487f99f 100644 --- a/tests/TestCase/Controller/ControllerTest.php +++ b/tests/TestCase/Controller/ControllerTest.php @@ -300,7 +300,11 @@ public function testUndefinedPropertyError() $controller->Bar = true; $this->assertTrue($controller->Bar); - $this->expectException(Notice::class); + if (class_exists(Notice::class)) { + $this->expectException(Notice::class); + } else { + $this->expectException(\PHPUnit_Framework_Error_Notice::class); + } $this->expectExceptionMessage(sprintf( 'Undefined property: Controller::$Foo in %s on line %s', __FILE__,