/**
  * 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);
 }
示例#2
0
文件: FrontTest.php 项目: lortnus/zf1
 /**
  * @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));
 }
示例#3
0
 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();
 }