Example #1
0
 protected function tearDown()
 {
     // clear registry for locale testing
     Zend_Registry::_unsetInstance();
     // restore default options value
     Zle_View_Helper_FormDatePicker::setDatePickerDefaultOptions($this->_helperOptions);
 }
Example #2
0
 public function tearDown()
 {
     $this->_helper = null;
     $this->_view = null;
     // View-Helpers use the registry!
     Zend_Registry::_unsetInstance();
 }
Example #3
0
 public static function minimalBootstrapAndGenerateFile()
 {
     self::minimalBootstrap();
     file_put_contents('cache/setup' . Kwf_Setup::CACHE_SETUP_VERSION . '.php', self::generateCode());
     Zend_Registry::_unsetInstance();
     //cache/setup?.php will call setClassName again
 }
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     $this->view = $this->getView();
     $this->jquery = new ZendX_JQuery_View_Helper_JQuery_Container();
     $this->jquery->setView($this->view);
     Zend_Registry::set('ZendX_JQuery_View_Helper_JQuery', $this->jquery);
 }
Example #5
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
     $this->view = $this->getView();
     $this->helper = new Zend_Dojo_View_Helper_ValidationTextBox();
     $this->helper->setView($this->view);
 }
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     $this->view = $this->getView();
     $this->helper = new ZendX_MooTools_View_Helper_MooTools_Container();
     $this->helper->setView($this->view);
     Zend_Registry::set('ZendX_MooTools_View_Helper_MooTools', $this->helper);
 }
Example #7
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
     $this->view = $this->getView();
     $this->helper = new Zend_Dojo_View_Helper_AccordionContainer();
     $this->helper->setView($this->view);
 }
 /**
  * @group ServerTests
  */
 public function testGetAnonServiceMap()
 {
     // unset registry (and the user object)
     Zend_Registry::_unsetInstance();
     $smd = Tinebase_Server_Json::getServiceMap();
     $smdArray = $smd->toArray();
     $this->assertTrue(isset($smdArray['services']['Tinebase.ping']));
 }
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
     $this->view = $this->getView();
     $this->helper = new Zend_Dojo_View_Helper_FilteringSelect();
     $this->helper->setView($this->view);
 }
Example #10
0
 public function tearDown()
 {
     $this->_helper = null;
     $this->_view = null;
     Robo47_View_Helper_Ckeditor::unsetDefaultOptions();
     // View-Helpers use the registry!
     Zend_Registry::_unsetInstance();
 }
Example #11
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
     $this->view = $this->getView();
     $this->element = $this->getElement();
     $this->element->setView($this->view);
 }
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     $this->view = $this->getView();
     $this->helper = new Zend_Dojo_View_Helper_Dojo_Container();
     $this->helper->setView($this->view);
     Zend_Registry::set('Zend_Dojo_View_Helper_Dojo', $this->helper);
     Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
 }
Example #13
0
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Form::setDefaultTranslator(null);
     if (isset($this->error)) {
         unset($this->error);
     }
     $this->element = new Zend_Form_Element('foo');
     Zend_Controller_Action_HelperBroker::resetHelpers();
 }
Example #14
0
 public function testHookStorageViaAddPluginHookFunction()
 {
     $this->broker->register();
     $this->broker->setCurrentPluginDirName('fake-plugin-name');
     add_plugin_hook('initialize', 'fake_plugin_initialize');
     // Using the registry should not interfere with the other unit tests.
     Zend_Registry::_unsetInstance();
     $callback = $this->broker->getHook('fake-plugin-name', 'initialize');
     $this->assertEquals('fake_plugin_initialize', $callback[0]);
 }
 public function tearDown()
 {
     $loader = Zend_Loader_Autoloader::getInstance();
     $HtmlPurifierLoaders = $loader->getNamespaceAutoloaders('HtmlPurifier');
     foreach ($HtmlPurifierLoaders as $hloader) {
         $loader->removeAutoloader($hloader, 'HtmlPurifier');
     }
     Robo47_Filter_HtmlPurifier::setDefaultPurifier();
     Zend_Registry::_unsetInstance();
 }
Example #16
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
     $this->view = $this->getView();
     $this->decorator = new Zend_Dojo_Form_Decorator_SplitContainer();
     $this->element = $this->getElement();
     $this->element->setView($this->view);
     $this->decorator->setElement($this->element);
 }
Example #17
0
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Form::setDefaultTranslator(null);
     if (isset($this->error)) {
         unset($this->error);
     }
     Zend_Controller_Action_HelperBroker::resetHelpers();
     $this->loader = new Zend_Loader_PluginLoader(array('Zend_Form_Decorator' => 'Zend/Form/Decorator'));
     $this->group = new Zend_Form_DisplayGroup('test', $this->loader);
 }
Example #18
0
 protected function tearDown()
 {
     // restore static variables
     if (isset($this->cache)) {
         Zend_Translate_Adapter::setCache($this->cache);
         unset($this->cache);
     } else {
         Zend_Translate_Adapter::removeCache();
     }
     // unset the registry
     Zend_Registry::_unsetInstance();
 }
Example #19
0
 public function tearDown()
 {
     /*
      * This is a bit dirty, since Zend_Registry should be "hidden",
      * but this is the only way to test this.
      * 
      * But since Waf_Registry does rely on Zend_Registry, and probably
      * always will, I see no point in contaminating 2 classes with these
      * dirty tricks to make it unit testable.
      * 
      */
     Zend_Registry::_unsetInstance();
 }
Example #20
0
 public function setUp()
 {
     // Store original autoloaders
     $this->loaders = spl_autoload_functions();
     if (!is_array($this->loaders)) {
         // spl_autoload_functions does not return empty array when no
         // autoloaders registered...
         $this->loaders = array();
     }
     Zend_Loader_Autoloader::resetInstance();
     $this->autoloader = Zend_Loader_Autoloader::getInstance();
     $this->application = new Zend_Application('testing');
     $this->bootstrap = new Zend_Application_Bootstrap_Bootstrap($this->application);
     Zend_Registry::_unsetInstance();
 }
Example #21
0
 public function setUp()
 {
     $this->serviceHelper = new Waf_Zend_Controller_Action_Helper_Service();
     $this->request = $this->getMock('Zend_Controller_Request_Http');
     $this->request->expects($this->any())->method('getModuleName')->will($this->returnValue('test'));
     $this->service = $this->getMock('Waf_Model_Service');
     $this->inflector = $this->getMock('Zend_Filter_Inflector');
     $this->inflector->expects($this->any())->method('filter')->will($this->returnValue(get_class($this->service)));
     Zend_Registry::_unsetInstance();
     $this->model = new Waf_Model();
     $this->model->register();
     $front = Zend_Controller_Front::getInstance();
     $front->resetInstance();
     $front->setRequest($this->request);
 }
Example #22
0
 /**
  * Resets all caches and drops the database
  */
 public function tearDown()
 {
     parent::tearDown();
     try {
         $plugins = Piwik_PluginsManager::getInstance()->getLoadedPlugins();
         foreach ($plugins as $plugin) {
             $plugin->uninstall();
         }
         Piwik_PluginsManager::getInstance()->unloadPlugins();
     } catch (Exception $e) {
     }
     Piwik::dropDatabase();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
     Piwik_Option::getInstance()->clearCache();
     Piwik_Site::clearCache();
     Piwik_Common::deleteTrackerCache();
     Piwik_Config::getInstance()->clear();
     Piwik_TablePartitioning::$tablesAlreadyInstalled = null;
     Zend_Registry::_unsetInstance();
 }
Example #23
0
 public static function setUp($configClass = 'Kwf_Config_Web')
 {
     error_reporting(E_ALL & ~E_STRICT);
     define('APP_PATH', getcwd());
     Kwf_Setup::$configClass = $configClass;
     if (PHP_SAPI == 'cli') {
         //don't use cached setup on cli so clear-cache will always work even if eg. paths change
         require_once dirname(__FILE__) . '/../Kwf/Util/Setup.php';
         Kwf_Util_Setup::minimalBootstrap();
         $setupCode = Kwf_Util_Setup::generateCode();
         Zend_Registry::_unsetInstance();
         eval(substr($setupCode, 5));
     } else {
         if (!@(include APP_PATH . '/cache/setup' . self::CACHE_SETUP_VERSION . '.php')) {
             if (!file_exists(APP_PATH . '/cache/setup' . self::CACHE_SETUP_VERSION . '.php')) {
                 require_once dirname(__FILE__) . '/../Kwf/Util/Setup.php';
                 Kwf_Util_Setup::minimalBootstrapAndGenerateFile();
             }
             include APP_PATH . '/cache/setup' . self::CACHE_SETUP_VERSION . '.php';
         }
     }
     Kwf_Benchmark::checkpoint('setUp');
 }
Example #24
0
 public static function tearDownAfterClass()
 {
     try {
         $plugins = Piwik_PluginsManager::getInstance()->getLoadedPlugins();
         foreach ($plugins as $plugin) {
             $plugin->uninstall();
         }
         Piwik_PluginsManager::getInstance()->unloadPlugins();
     } catch (Exception $e) {
     }
     Piwik::dropDatabase();
     Piwik_DataTable_Manager::getInstance()->deleteAll();
     Piwik_Option::getInstance()->clearCache();
     Piwik_Site::clearCache();
     Piwik_Common::deleteTrackerCache();
     Piwik_Config::getInstance()->clear();
     Piwik_TablePartitioning::$tablesAlreadyInstalled = null;
     Zend_Registry::_unsetInstance();
     $_GET = $_REQUEST = array();
     Piwik_Translate::getInstance()->unloadEnglishTranslation();
     // re-enable tag cloud shuffling
     Piwik_Visualization_Cloud::$debugDisableShuffle = true;
 }
 /**
  * Method to initialize Zend_Application for each test.
  */
 public function setUpWithEnv($applicationEnv)
 {
     // Reducing memory footprint by forcing garbage collection runs
     // WARNING: Did not work on CI-System (PHP 5.3.14, PHPnit 3.5.13)
     // gc_collect_cycles();
     $this->closeLogfile();
     $this->closeDatabaseConnection();
     // Resetting singletons or other kinds of persistent objects.
     Opus_Db_TableGateway::clearInstances();
     // FIXME Does it help with the mystery bug?
     Zend_Registry::_unsetInstance();
     // Reset autoloader to fix huge memory/cpu-time leak
     Zend_Loader_Autoloader::resetInstance();
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->suppressNotFoundWarnings(false);
     $autoloader->setFallbackAutoloader(true);
     // Clean-up possible artifacts in $_SERVER of previous test.
     unset($_SERVER['REMOTE_ADDR']);
     $this->bootstrap = new Zend_Application($applicationEnv, array("config" => array(APPLICATION_PATH . '/application/configs/application.ini', APPLICATION_PATH . '/tests/tests.ini', APPLICATION_PATH . '/tests/config.ini')));
     // added to ensure that application log messages are written to opus.log when running unit tests
     // if not set messages are written to opus-console.log
     $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
     parent::setUp();
 }
Example #26
0
 public function tearDown()
 {
     Zend_Registry::_unsetInstance();
 }
Example #27
0
 public function tearDown()
 {
     unset($this->repositoryHelper);
     Zend_Registry::_unsetInstance();
 }
 public function testZF3679()
 {
     require_once 'Zend/Locale.php';
     $locale = new Zend_Locale('de_AT');
     require_once 'Zend/Registry.php';
     Zend_Registry::set('Zend_Locale', $locale);
     $lang = new Zend_Translate(Zend_Translate::AN_ARRAY, array('msg1' => 'message1'), 'de_AT');
     $this->assertEquals('de_AT', $lang->getLocale());
     Zend_Registry::_unsetInstance();
 }
Example #29
0
 /**
  * primarily for tearDown() in unit tests
  *
  * @deprecated Since 0.9.0 -- Use Zend_Registry::_unsetInstance() instead.
  */
 public static function __unsetRegistry()
 {
     trigger_error(__CLASS__ . "::" . __FUNCTION__ . " deprecated since 0.9.0, use Zend_Registry::_unsetInstance() instead");
     require_once 'Zend/Registry.php';
     Zend_Registry::_unsetInstance();
 }
Example #30
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     Zend_Registry::_unsetInstance();
     Zend_Form::setDefaultTranslator(null);
     $this->element = new Zend_Form_Element_Submit('foo');
 }