当前位置: 首页>>代码示例>>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;未经允许,请勿转载。