Browse Source

Fix test for phpunit 5.7.

ADmad 7 years ago
parent
commit
a8922fdfdb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      tests/TestCase/Controller/ControllerTest.php

+ 5 - 1
tests/TestCase/Controller/ControllerTest.php

@@ -300,7 +300,11 @@ class ControllerTest extends TestCase
         $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__,