Allowing tests to run on PHP 7

This commit is contained in:
Larry E. Masters 2015-12-13 14:12:31 -06:00
parent dcac9c4a0c
commit 48e018e707
4 changed files with 21 additions and 6 deletions

View file

@ -51,9 +51,11 @@ class ControllerAuthorizeTest extends CakeTestCase {
* @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);
}
}
/**

View file

@ -454,7 +454,12 @@ class ConfigureTest extends CakeTestCase {
*/
public function testReaderExceptionOnIncorrectClass() {
$reader = new StdClass();
Configure::config('test', $reader);
try {
Configure::config('test', $reader);
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}
/**

View file

@ -2912,7 +2912,11 @@ SQL;
* @return void
*/
public function testDropSchemaNoSchema() {
$this->Dbo->dropSchema(null);
try {
$this->Dbo->dropSchema(null);
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}
/**

View file

@ -2227,7 +2227,11 @@ class ModelValidationTest extends BaseModelTest {
* @return void
*/
public function testValidatorTypehintException() {
new ModelValidator('asdasds');
try {
new ModelValidator('asdasds');
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
}
}
/**