mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 17:42:41 +00:00
Allowing tests to run on PHP 7
This commit is contained in:
parent
dcac9c4a0c
commit
48e018e707
4 changed files with 21 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue