/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ public function setUp() { $this->errorHandler = $this->getMock('Enlight_Extensions_ErrorHandler_Bootstrap', null, array('')); $namespace = new Enlight_Plugin_Namespace_Loader('Extensions'); $namespace->registerPlugin($this->errorHandler); parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ public function setUp() { $this->log = $this->getMock('Enlight_Extensions_Log_Bootstrap', null, array('Json')); $namespace = new Enlight_Plugin_Namespace_Loader('Extensions'); $namespace->registerPlugin($this->log); parent::setUp(); }
public function setUp() { $this->json = $this->getMock('Enlight_Controller_Plugins_Json_Bootstrap', null, array('Json')); $viewRenderer = $this->getMock('Enlight_Controller_Plugins_ViewRenderer_Bootstrap', null, array('ViewRenderer')); $namespace = new Enlight_Plugin_Namespace_Loader('Controller'); $namespace->registerPlugin($this->json); $namespace->registerPlugin($viewRenderer); }
/** * Setter method for the plugin property. * * @throws Enlight_Exception * @param string|Enlight_Plugin_Namespace $plugins * @return Enlight_Controller_Front */ public function setPlugins(Enlight_Plugin_Namespace $plugins = null) { if ($plugins === null) { $plugins = new Enlight_Plugin_Namespace_Loader('Controller'); $plugins->addPrefixPath('Enlight_Controller_Plugins', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Plugins'); } $this->plugins = $plugins; return $this; }
/** * Test case */ public function testOnDispatchLoopShutdown() { $debug = new Enlight_Extensions_Debug_Bootstrap('Debug'); $errorHandler = $this->getMock('Enlight_Extensions_ErrorHandler_Bootstrap', array('getErrorLog'), array('ErrorHandler')); $errorHandler->expects($this->once())->method('getErrorLog')->will($this->returnValue(array(array('count' => 1, 'code' => E_ERROR, 'name' => 'test', 'message' => 'test', 'line' => 1, 'file' => __FILE__)))); $namespace = new Enlight_Plugin_Namespace_Loader('TestDebug'); $namespace->registerPlugin($errorHandler); $namespace->registerPlugin($debug); $log = $this->getMock('Enlight_Components_Log', array('table', 'err')); $log->expects($this->exactly(2))->method('table')->with($this->isType('array')); $log->expects($this->once())->method('err')->with($this->isType('string')); $debug->setLog($log); $response = $this->Response(); $response->setException(new Enlight_Exception('test', 123)); $front = $this->Front()->setResponse($response); $eventArgs = $this->createEventArgs(array('subject' => $front)); $this->assertEquals(null, $debug->onDispatchLoopShutdown($eventArgs)); }