/** * Checks if the action helpers are cleaned up correctly after * each test. */ public function testActionHelpersAreResetted() { $previousHelpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); $test = $this->createTestCase('testAddActionHelper'); $result = $test->run(); $this->assertSuccessful($result); $currentHelpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); $this->assertEquals($previousHelpers, $currentHelpers); }
/** * @see ZF-3145 */ public function testResetInstanceShouldResetHelperBroker() { Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer()); Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_Url()); $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); $this->assertTrue(is_array($helpers)); $this->assertFalse(empty($helpers)); $this->_controller->resetInstance(); $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); $this->assertTrue(is_array($helpers)); $this->assertTrue(empty($helpers)); }
public function testGetHelperStatically() { $helper = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $this->assertTrue($helper instanceof Zend_Controller_Action_Helper_ViewRenderer); $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); $this->assertTrue(is_array($helpers)); $this->assertEquals(1, count($helpers)); }
/** * Sets up the action helpers. */ protected function storeActionHelpers() { $this->previousActionHelpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); Zend_Controller_Action_HelperBroker::resetHelpers(); }