mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Adding additional class_exists tests to configure.test.php for App::import usage.
This commit is contained in:
parent
1ed4a63416
commit
33117ee13d
1 changed files with 9 additions and 0 deletions
|
@ -409,21 +409,26 @@ class AppImportTest extends UnitTestCase {
|
|||
|
||||
$file = App::import('Model', 'Model', false);
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('Model'));
|
||||
|
||||
$file = App::import('Controller', 'Controller', false);
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('Controller'));
|
||||
|
||||
$file = App::import('Component', 'Component', false);
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('Component'));
|
||||
|
||||
$file = App::import('Shell', 'Shell', false);
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('Shell'));
|
||||
|
||||
$file = App::import('Model', 'SomeRandomModelThatDoesNotExist', false);
|
||||
$this->assertFalse($file);
|
||||
|
||||
$file = App::import('Model', 'AppModel', false);
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('AppModel'));
|
||||
|
||||
$file = App::import('WrongType', null, true, array(), '');
|
||||
$this->assertTrue($file);
|
||||
|
@ -456,6 +461,7 @@ class AppImportTest extends UnitTestCase {
|
|||
|
||||
$file = App::import('Controller', 'Pages');
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('PagesController'));
|
||||
|
||||
$classes = array_flip(get_declared_classes());
|
||||
|
||||
|
@ -469,12 +475,15 @@ class AppImportTest extends UnitTestCase {
|
|||
|
||||
$file = App::import('Behavior', 'Containable');
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('ContainableBehavior'));
|
||||
|
||||
$file = App::import('Component', 'RequestHandler');
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('RequestHandlerComponent'));
|
||||
|
||||
$file = App::import('Helper', 'Form');
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('FormHelper'));
|
||||
|
||||
$file = App::import('Model', 'NonExistingModel');
|
||||
$this->assertFalse($file);
|
||||
|
|
Loading…
Add table
Reference in a new issue