Merge pull request #105 from tPl0ch/2.0-bake-controller

Unloading TestPlugin in ShellTest
This commit is contained in:
ADmad 2011-05-29 07:49:58 -07:00
commit 26dc6c8048

View file

@ -172,21 +172,22 @@ class ShellTest extends CakeTestCase {
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS) 'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
), true); ), true);
CakePlugin::load('TestPlugin');
CakePlugin::load('TestPlugin');
$this->Shell->uses = array('TestPlugin.TestPluginPost'); $this->Shell->uses = array('TestPlugin.TestPluginPost');
$this->Shell->initialize(); $this->Shell->initialize();
$this->assertTrue(isset($this->Shell->TestPluginPost)); $this->assertTrue(isset($this->Shell->TestPluginPost));
$this->assertInstanceOf('TestPluginPost', $this->Shell->TestPluginPost); $this->assertInstanceOf('TestPluginPost', $this->Shell->TestPluginPost);
$this->assertEqual($this->Shell->modelClass, 'TestPluginPost'); $this->assertEqual($this->Shell->modelClass, 'TestPluginPost');
CakePlugin::unload('TestPlugin');
$this->Shell->uses = array('Comment'); $this->Shell->uses = array('Comment');
$this->Shell->initialize(); $this->Shell->initialize();
$this->assertTrue(isset($this->Shell->Comment)); $this->assertTrue(isset($this->Shell->Comment));
$this->assertInstanceOf('Comment', $this->Shell->Comment); $this->assertInstanceOf('Comment', $this->Shell->Comment);
$this->assertEqual($this->Shell->modelClass, 'Comment'); $this->assertEqual($this->Shell->modelClass, 'Comment');
App::build(); App::build();
} }