public function testCallReturnsPluginIfPluginIsNotCallable() { $plugins = new ControllerPlugins(); $plugin = new \stdClass(); $plugins->set('foo', $plugin); $controller = new PluginsTraitTemplate(); $controller->setPlugins($plugins); $return = $controller->foo(); $this->assertSame($return, $plugin); }
public function testGetUrl() { $url = new Url(); $plugins = new ControllerPlugins(); $plugins->set('url', $url); $services = new Services(); $services->set('ControllerPlugins', $plugins); $this->setServices($services); $plugin = new Redirect(); $this->assertSame($url, $plugin->getUrl()); }
public function testExteptionClassWhenPluginNotFound() { $plugins = new ControllerPlugins(); $this->setExpectedException(ControllerPluginNotFoundException::CLASS); $plugins->get('foo'); }