當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Session::_unitTestEnabled方法代碼示例

本文整理匯總了PHP中Zend_Session::_unitTestEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Session::_unitTestEnabled方法的具體用法?PHP Zend_Session::_unitTestEnabled怎麽用?PHP Zend_Session::_unitTestEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Session的用法示例。


在下文中一共展示了Zend_Session::_unitTestEnabled方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initFramework

 /**
  * init the test framework
  */
 public function initFramework()
 {
     $this->setWhiteAndBlacklists();
     // get config
     $configData = @(include 'phpunitconfig.inc.php');
     if ($configData === false) {
         $configData = (include 'config.inc.php');
     }
     if ($configData === false) {
         die('central configuration file config.inc.php not found in includepath: ' . get_include_path());
     }
     $config = new Zend_Config($configData);
     Zend_Registry::set('testConfig', $config);
     $_SERVER['DOCUMENT_ROOT'] = $config->docroot;
     $_SERVER['REQUEST_URI'] = '';
     Tinebase_Core::startCoreSession();
     Tinebase_Core::initFramework();
     // set default test mailer
     Tinebase_Smtp::setDefaultTransport(new Zend_Mail_Transport_Array());
     // set max execution time
     Tinebase_Core::setExecutionLifeTime(1200);
     if ($config->locale) {
         Tinebase_Core::setupUserLocale($config->locale);
     }
     // this is needed for session handling in unittests (deactivate Zend_Session::writeClose and others)
     Zend_Session::$_unitTestEnabled = TRUE;
 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:30,代碼來源:TestServer.php

示例2: setUp

 public function setUp()
 {
     $options = array('env' => 'testing', 'resources' => array('Cache', 'Config', 'Path', 'Session'));
     $path = GENE_APP_PATH;
     Gene::app($path, $options);
     Zend_Session::$_unitTestEnabled = true;
 }
開發者ID:heavenshell,項目名稱:gene,代碼行數:7,代碼來源:SessionTest.php

示例3: testAccountBlocking

    /**
     * @group ServerTests
     */
    public function testAccountBlocking()
    {
        Zend_Session::$_unitTestEnabled = true;
        $request = \Zend\Http\PhpEnvironment\Request::fromString(<<<EOS
POST /index.php HTTP/1.1
Content-Type: application/json
Content-Length: 122
Host: 192.168.122.158
Connection: keep-alive
Origin: http://192.168.1.158
X-Tine20-Request-Type: JSON
X-Tine20-Jsonkey: undefined
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36
X-Tine20-Transactionid: 9c7129898e9f8ab7e4621fddf7077a1eaa425aac
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: http://192.168.122.158/tine20dev/
Accept-Encoding: gzip,deflate
Accept-Language: de-DE,de;q=0.8,en-GB;q=0.6,en;q=0.4
EOS
);
        $credentials = $this->getTestCredentials();
        $maxLoginFailures = Tinebase_Config::getInstance()->get(Tinebase_Config::MAX_LOGIN_FAILURES, 5);
        for ($i = 0; $i <= $maxLoginFailures; $i++) {
            $result = Tinebase_Controller::getInstance()->login($credentials['username'], 'foobar', $request);
            $this->assertFalse($result);
        }
        // account must be blocked now
        $result = Tinebase_Controller::getInstance()->login($credentials['username'], $credentials['password'], $request);
        $this->assertFalse($result);
    }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:34,代碼來源:ControllerServerTest.php

示例4: setUp

 protected function setUp()
 {
     $this->_frontController = System_Application::getInstance()->getBootstrap()->getResource('FrontController');
     $this->frontController->setParam('bootstrap', System_Application::getInstance()->getBootstrap());
     $this->getRequest()->setBaseUrl($this->frontController->getBaseUrl());
     Zend_Session::$_unitTestEnabled = true;
 }
開發者ID:kandy,項目名稱:system,代碼行數:7,代碼來源:AjaxTestCase.php

示例5: tearDown

 /**
  * tear down tests
  */
 protected function tearDown()
 {
     Zend_Session::$_unitTestEnabled = false;
     if ($this->_transactionId) {
         Tinebase_TransactionManager::getInstance()->rollBack();
     }
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:10,代碼來源:ServerTestCase.php

示例6: testInitSetsSaveHandler

 public function testInitSetsSaveHandler()
 {
     Zend_Session::$_unitTestEnabled = true;
     $saveHandler = $this->getMock('Zend_Session_SaveHandler_Interface');
     $this->resource->setSaveHandler($saveHandler);
     $this->resource->init();
     $this->assertSame($saveHandler, Zend_Session::getSaveHandler());
 }
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:8,代碼來源:SessionTest.php

示例7: setUp

 protected function setUp()
 {
     \Zend_Controller_Front::getInstance()->resetInstance();
     $this->request = new \Zend_Controller_Request_Http();
     \Zend_Session::$_unitTestEnabled = true;
     $this->acl = new \Zend_Acl();
     $this->acl->deny();
     $this->acl->addRole(new \Zend_Acl_Role(Acl::ROLE_GUEST));
     $this->acl->addRole(new \Zend_Acl_Role(Acl::ROLE_AUTHENTICATED), Acl::ROLE_GUEST);
     parent::setUp();
 }
開發者ID:lukaszjankowski,項目名稱:alchemy,代碼行數:11,代碼來源:AclTest.php

示例8: testShouldNotAuthNoExistingUserAndReturnErrorCode

 public function testShouldNotAuthNoExistingUserAndReturnErrorCode()
 {
     //GIVEN
     Zend_Session::$_unitTestEnabled = true;
     $oApiUser = new AM_Api_User();
     //WHEN
     $aResult = $oApiUser->login('no-existing-user', 'password');
     //THEN
     $aExpectedResult = array('code' => Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, 'messages' => array('A record with the supplied identity could not be found.'));
     $this->assertEquals($aExpectedResult, $aResult);
 }
開發者ID:pansot2,項目名稱:PadCMS-backend,代碼行數:11,代碼來源:ApiUserLoginTest.php

示例9: setUp

 static function setUp()
 {
     set_include_path(implode(PATH_SEPARATOR, array(realpath(dirname(__FILE__) . '/../application'), realpath(dirname(__FILE__) . '/../library'), get_include_path())));
     require_once realpath(dirname(__FILE__) . '/../application/Bootstrap.php');
     require_once 'Zend/Loader/Autoloader.php';
     Zend_Loader_Autoloader::getInstance();
     self::$bootstrap = new Bootstrap(getenv('APPLICATION_ENV'));
     Zend_Session::$_unitTestEnabled = true;
     Zend_Loader::loadClass('Sql');
     $sql = new Sql();
     $sql->reset();
 }
開發者ID:joshauza,項目名稱:baseapp,代碼行數:12,代碼來源:TestConfiguration.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->rediska->set('user_ids:test', 1);
     $data = new stdClass();
     $data->login = 'test';
     $data->password = 'test';
     $this->rediska->set('users:1', $data);
     Zend_Session::$_unitTestEnabled = true;
     $this->auth = Zend_Auth::getInstance();
     $this->adapter = new Rediska_Zend_Auth_Adapter_Redis();
 }
開發者ID:r-kovalenko,項目名稱:Rediska,代碼行數:12,代碼來源:AuthTest.php

示例11: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     require_once 'var/Test/ServiceMock.php';
     require_once 'var/Test/BeforeHookMock.php';
     require_once 'var/Test/AfterHookMock.php';
     require_once 'var/Test/Validator.php';
     $iniPath = GENE_TEST_ROOT . '/var/config/database.ini';
     $file = GENE_TEST_ROOT . '/var/sql/create.sql';
     Gene_TestHelper::trancate($iniPath, $file, 'production');
     $options = array('env' => 'testing', 'resources' => array('Cache', 'Config', 'Path', 'Db'));
     $path = GENE_APP_PATH;
     Gene::app($path, $options);
     Zend_Session::$_unitTestEnabled = true;
 }
開發者ID:heavenshell,項目名稱:gene,代碼行數:14,代碼來源:ServiceTest.php

示例12: _init

 protected function _init($componentClass)
 {
     Kwf_Component_Data_Root::setComponentClass($componentClass);
     Zend_Session::$_unitTestEnabled = true;
     $this->_root = Kwf_Component_Data_Root::getInstance();
     $this->_root->setFilename('kwf/kwctest/' . $componentClass);
     if (function_exists('apc_clear_cache')) {
         apc_clear_cache('user');
     }
     Kwf_Component_Cache_Memory::getInstance()->_clean();
     Kwf_Cache_Simple::resetZendCache();
     Kwc_FulltextSearch_MetaModel::setInstance(new Kwf_Model_FnF(array('primaryKey' => 'page_id')));
     Kwf_Assets_Package_Default::clearInstances();
     Kwf_Component_LogDuplicateModel::setInstance(new Kwf_Model_FnF(array()));
     Kwf_Media_MemoryCache::getInstance()->clean();
     return $this->_root;
 }
開發者ID:nsams,項目名稱:koala-framework,代碼行數:17,代碼來源:TestCase.php

示例13: tearDown

 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 public function tearDown()
 {
     $registry = Zend_Registry::getInstance();
     if (isset($registry['router'])) {
         unset($registry['router']);
     }
     if (isset($registry['dispatcher'])) {
         unset($registry['dispatcher']);
     }
     if (isset($registry['plugin'])) {
         unset($registry['plugin']);
     }
     if (isset($registry['viewRenderer'])) {
         unset($registry['viewRenderer']);
     }
     Zend_Session::$_unitTestEnabled = false;
     session_id(uniqid());
 }
開發者ID:uglide,項目名稱:zfcore-transition,代碼行數:24,代碼來源:ControllerTestCaseTest.php

示例14: setUp

 /**
  * Set up the test case
  */
 public function setUp()
 {
     parent::setUp();
     $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $this->db = Enlight_Components_Db::factory('PDO_SQLITE', array('dbname' => Enlight_TestHelper::Instance()->TestPath('TempFiles') . 'auth.db'));
     $this->lockeduntilColumn = 'lockeduntil';
     $this->createDb($this->lockeduntilColumn);
     $this->createDefaultUser($this->lockeduntilColumn);
     // Needed to simulate web environment - otherwise we would get a nasty notice.
     $GLOBALS['_SESSION'] = array();
     Zend_Session::$_unitTestEnabled = true;
     Zend_Session::start();
     $this->auth = Enlight_Components_Auth::getInstance();
     $this->authAdapter = new Enlight_Components_Auth_Adapter_DbTable($this->db, 'test_auth', 'username', 'password');
     $this->authAdapter->setIdentityColumn('username')->setCredentialColumn('password')->setExpiryColumn('lastlogin')->setSessionIdColumn('sessionID')->setSessionId('s4inr04o6apmclk7u88qau4r57');
     $storage = new Zend_Auth_Storage_Session('Enlight', 'Auth');
     $this->auth->setAdapter($this->authAdapter);
     $this->assertInstanceOf('Enlight_Components_Auth_Adapter_DbTable', $this->auth->getAdapter());
     $this->auth->setStorage($storage);
 }
開發者ID:nvdnkpr,項目名稱:Enlight,代碼行數:23,代碼來源:DbTableTest.php

示例15: initFramework

 /**
  * init the test framework
  */
 public function initFramework()
 {
     $this->setWhiteAndBlacklists();
     $config = $this->getConfig();
     // set some server vars. sabredav complains if REQUEST_URI is not set
     $_SERVER['DOCUMENT_ROOT'] = $config->docroot;
     $_SERVER['REQUEST_URI'] = '';
     Tinebase_Core::startCoreSession();
     Tinebase_Core::initFramework();
     // set default test mailer
     Tinebase_Smtp::setDefaultTransport(new Zend_Mail_Transport_Array());
     // set max execution time
     Tinebase_Core::setExecutionLifeTime(1200);
     if ($config->locale) {
         Tinebase_Core::setupUserLocale($config->locale);
     }
     // this is needed for session handling in unittests (deactivate Zend_Session::writeClose and others)
     Zend_Session::$_unitTestEnabled = TRUE;
     Tinebase_Core::set('frameworkInitialized', true);
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:23,代碼來源:TestServer.php


注:本文中的Zend_Session::_unitTestEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。