Skip to content

Commit

Permalink
Allowing tests to run on PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry E. Masters committed Dec 13, 2015
1 parent dcac9c4 commit 48e018e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
Expand Up @@ -51,9 +51,11 @@ public function setUp() {
* @return void
*/
public function testControllerTypeError() {
$this->skipIf(version_compare(PHP_VERSION, '7.0', '<='), 'PHP Type Error in PHP7+');

$this->auth->controller(new StdClass());
try {
$this->auth->controller(new StdClass());
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}

/**
Expand Down
7 changes: 6 additions & 1 deletion lib/Cake/Test/Case/Core/ConfigureTest.php
Expand Up @@ -454,7 +454,12 @@ public function testReaderSetup() {
*/
public function testReaderExceptionOnIncorrectClass() {
$reader = new StdClass();
Configure::config('test', $reader);

try {
Configure::config('test', $reader);
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -2912,7 +2912,11 @@ public function testSchema() {
* @return void
*/
public function testDropSchemaNoSchema() {
$this->Dbo->dropSchema(null);
try {
$this->Dbo->dropSchema(null);
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion lib/Cake/Test/Case/Model/ModelValidationTest.php
Expand Up @@ -2227,7 +2227,11 @@ public function testValidatorOverride() {
* @return void
*/
public function testValidatorTypehintException() {
new ModelValidator('asdasds');
try {
new ModelValidator('asdasds');
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}

/**
Expand Down

0 comments on commit 48e018e

Please sign in to comment.