Skip to content
Permalink
Browse files

Separated test since PHP 7 behaves differently

PHPUnit does not catch BaseException yet (introduced in PHP 7), so adding a separated test to verify it
  • Loading branch information...
jrbasso committed Mar 29, 2015
1 parent 30bf826 commit 29be1fe8969d70f0f8a6a73227f21176cf33cd49
Showing with 20 additions and 3 deletions.
  1. +20 −3 tests/TestCase/Core/ConfigureTest.php
@@ -463,13 +463,30 @@ public function testEngineSetup()
/**
* test engine() throwing exceptions on missing interface.
*
* @expectedException \PHPUnit_Framework_Error
* @return void
*/
public function testEngineExceptionOnIncorrectClass()
{
$engine = new \StdClass();
Configure::config('test', $engine);
$this->skipIf(PHP_VERSION_ID >= 70000);
$this->setExpectedException('PHPUnit_Framework_Error');
Configure::config('test', new \stdClass());
}
/**
* test engine() throwing exceptions on missing interface (PHP 7)
*
* @return void
*/
public function testEngineExceptionOnIncorrectClassPhp7()
{
$this->skipIf(PHP_VERSION_ID < 70000);
try {
Configure::config('test', new \stdClass());
} catch (\BaseException $e) {
$this->assertTrue(true);
}
}
/**

0 comments on commit 29be1fe

Please sign in to comment.
You can’t perform that action at this time.