/** * testLoadModel method from a plugin controller * * @return void */ public function testLoadModelInPlugins() { Plugin::load('TestPlugin'); $Controller = new TestPluginController(); $Controller->plugin = 'TestPlugin'; $this->assertFalse(isset($Controller->TestPluginComments)); $result = $Controller->loadModel('TestPlugin.TestPluginComments'); $this->assertInstanceOf('TestPlugin\\Model\\Table\\TestPluginCommentsTable', $result); $this->assertInstanceOf('TestPlugin\\Model\\Table\\TestPluginCommentsTable', $Controller->TestPluginComments); }
/** * testLoadModel method from a plugin controller * * @return void */ public function testLoadModelInPlugins() { Configure::write('App.namespace', 'TestApp'); Plugin::load('TestPlugin'); $Controller = new TestPluginController(); $Controller->plugin = 'TestPlugin'; $this->assertFalse(isset($Controller->TestPluginComments)); $result = $Controller->loadModel('TestPlugin.TestPluginComments'); $this->assertTrue($result); $this->assertInstanceOf('TestPlugin\\Model\\Table\\TestPluginCommentsTable', $Controller->TestPluginComments); }