Skip to content

Commit

Permalink
Fix test for phpunit 5.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Sep 25, 2018
1 parent 3c3d86d commit a8922fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/TestCase/Controller/ControllerTest.php
Expand Up @@ -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__,
Expand Down

0 comments on commit a8922fd

Please sign in to comment.