Skip to content

Commit

Permalink
Test to prove that autoload is in incorrect order
Browse files Browse the repository at this point in the history
  • Loading branch information
Walther Lalk committed Feb 24, 2015
1 parent 832332e commit 3974c38
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/TestCase/Core/PluginTest.php
Expand Up @@ -88,6 +88,29 @@ class_exists('Company\TestPluginThree\Utility\Hello'),
);
}

/**
* Test load() with the autoload option.
*
* @return void
*/
public function testLoadSingleWithAutoloadAndBootstrap()
{
$this->assertFalse(class_exists('Company\TestPluginThree\Utility\Hello'));
Plugin::load(
'Company/TestPluginThree',
[
'autoload' => true,
'bootstrap' => true
]
);
$this->assertTrue(Configure::read('PluginTest.test_plugin_three.autoload'));
$this->assertEquals('loaded plugin three bootstrap', Configure::read('PluginTest.test_plugin_three.bootstrap'));
$this->assertTrue(
class_exists('Company\TestPluginThree\Utility\Hello'),
'Class should be loaded'
);
}

/**
* Tests loading a plugin and its bootstrap file
*
Expand Down
Expand Up @@ -2,3 +2,4 @@
use Cake\Core\Configure;

Configure::write('PluginTest.test_plugin_three.bootstrap', 'loaded plugin three bootstrap');
Configure::write('PluginTest.test_plugin_three.autoload', class_exists('Company\TestPluginThree\Utility\Hello'));

0 comments on commit 3974c38

Please sign in to comment.