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


PHP lmbToolkit::restore方法代碼示例

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


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

示例1: testIsDefaultDbDSNAvailable

 function testIsDefaultDbDSNAvailable()
 {
     $tools = new lmbDbTools();
     $tools->setDefaultDbDSN("mysql://localhost/test");
     $this->assertTrue($tools->isDefaultDbDSNAvailable());
     $toolkit = lmbToolkit::save();
     $tools = new lmbDbTools();
     $toolkit->setConf('db', new ExceptionalDbConfStub());
     $this->assertFalse($tools->isDefaultDbDSNAvailable());
     lmbToolkit::restore();
 }
開發者ID:knevcher,項目名稱:limb,代碼行數:11,代碼來源:lmbDbToolsTest.class.php

示例2: tearDown

 function tearDown()
 {
     $this->_cleanUp();
     $this->conn->disconnect();
     lmbToolkit::restore();
     $connection = lmbToolkit::instance()->getDefaultDbConnection();
     if (method_exists($connection, 'isValid')) {
         if (!$connection->isValid()) {
             $connection->connect();
         }
     }
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:12,代碼來源:lmbARBaseTestCase.class.php

示例3: testUseRussianAsCurrentLocale

 function testUseRussianAsCurrentLocale()
 {
     $toolkit = lmbToolkit::save();
     $toolkit->addLocaleObject(new lmbLocale('ru_RU', new lmbIni(dirname(__FILE__) . '/../../../i18n/locale/ru_RU.ini')));
     $date = new lmbDateTime('2004-12-20 10:15:30');
     $time = $date->getStamp();
     $code = '{$#var|i18n_date:"ru_RU", "stamp"}';
     $tpl = $this->_createMacroTemplate($code, 'tpl.html');
     $tpl->set('var', $time);
     $out = $tpl->render();
     $this->assertEqual($out, '20.12.2004');
     lmbToolkit::restore();
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:13,代碼來源:lmbI18NDateMacroFilterTest.class.php

示例4: testIsRequestAvailableInControllerConstructor

 function testIsRequestAvailableInControllerConstructor()
 {
     //this is quite a "hacky" trick which removes the fixture toolkit, this should be refactored
     //alas, this means the whole test suite must be reconsidered as well
     lmbToolkit::restore();
     lmbToolkit::save();
     $dispatched_params = array('controller' => 'RememberRequestParams', 'param' => 150);
     $this->_setUpMocks($dispatched_params);
     $this->filter->run($this->chain);
     $controller = $this->toolkit->getDispatchedController();
     $this->assertEqual($controller->param, $dispatched_params['param']);
     //trick again...
     lmbToolkit::restore();
     lmbToolkit::save();
 }
開發者ID:knevcher,項目名稱:limb,代碼行數:15,代碼來源:lmbRequestDispatchingFilterTest.class.php

示例5: tearDown

 function tearDown()
 {
     lmbToolkit::restore();
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:4,代碼來源:lmbLogToolsTest.class.php

示例6: tearDown

 function tearDown()
 {
     $this->_cleanUp();
     lmbToolkit::restore();
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:5,代碼來源:lmbTableGatewayTest.class.php

示例7: testTranslateSubstituteParametersDefaultContext

    function testTranslateSubstituteParametersDefaultContext()
    {
        $toolkit = lmbToolkit::save();
        $back = new lmbQtDictionaryBackend();
        $back->setSearchPath($translations_dir = LIMB_VAR_DIR . '/translations');
        $toolkit->setDictionaryBackend($back);
        $xml = <<<EOD
<?xml version="1.0"?>
<!DOCTYPE TS><TS>
<context>
<message>
    <source>Hello {name}</source>
    <translation>Привет {name}</translation>
</message>
</context>
</TS>
EOD;
        file_put_contents($translations_dir . '/default.ru_RU.ts', $xml);
        $toolkit->setLocale('ru_RU');
        $this->assertEqual(lmb_i18n('Hello {name}', array('{name}' => 'Bob')), 'Привет Bob');
        lmbToolkit::restore();
    }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:22,代碼來源:lmbI18NTranslationTest.class.php

示例8: testOverloadGetterByTools

 function testOverloadGetterByTools()
 {
     lmbToolkit::save();
     $toolkit = lmbToolkit::setup(new TestTools());
     $toolkit->set('var', 'value1');
     $this->assertEqual($toolkit->getVar(), 'value1');
     lmbToolkit::save();
     $toolkit->setVar('value2');
     $this->assertEqual($toolkit->getVar(), 'value2');
     lmbToolkit::restore();
     $this->assertEqual($toolkit->get('var'), 'value1');
     lmbToolkit::restore();
 }
開發者ID:anykey84,項目名稱:YaBackup,代碼行數:13,代碼來源:lmbToolkitTest.class.php

示例9: tearDown

 function tearDown()
 {
     $this->db->delete('test_db_table');
     lmbToolkit::restore();
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:5,代碼來源:lmbAutoDbTransactionFilterTest.class.php

示例10: tearDown

 function tearDown()
 {
     $this->cache_writer->flushAll();
     lmbToolkit::restore();
 }
開發者ID:snowjobgit,項目名稱:limb,代碼行數:5,代碼來源:lmbFullPageCacheAcceptanceTest.class.php

示例11: tearDown

 function tearDown()
 {
     lmbToolkit::restore();
     lmbFs::rm($this->application_configs_dir);
     lmbFs::rm($this->package_configs_dir);
 }
開發者ID:anykey84,項目名稱:YaBackup,代碼行數:6,代碼來源:lmbConfToolsTest.class.php

示例12: tearDown

 function tearDown()
 {
     $this->locator->clearTestingTemplates();
     lmbToolkit::restore();
 }
開發者ID:knevcher,項目名稱:limb,代碼行數:5,代碼來源:lmbWactTestCase.class.php

示例13: testDBEUseRussianAsCurrentLocale

 function testDBEUseRussianAsCurrentLocale()
 {
     $toolkit = lmbToolkit::save();
     $toolkit->addLocaleObject(new lmbLocale('ru', new lmbIni(dirname(__FILE__) . '/../ru.ini')));
     $date = new lmbDateTime('2005-01-20 10:15:30');
     $template = '{$var|i18n_date:"ru", "stamp"}';
     $this->registerTestingTemplate('/limb/locale_date_filter_dbe_use_russian_locale.html', $template);
     $page = $this->initTemplate('/limb/locale_date_filter_dbe_use_russian_locale.html');
     $page->set('var', $date->getStamp());
     $this->assertEqual($page->capture(), '20.01.2005');
     lmbToolkit::restore();
 }
開發者ID:knevcher,項目名稱:limb,代碼行數:12,代碼來源:lmbI18NDateFilterTest.class.php


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