本文整理汇总了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();
}
示例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();
}
}
}
示例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();
}
示例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();
}
示例5: tearDown
function tearDown()
{
lmbToolkit::restore();
}
示例6: tearDown
function tearDown()
{
$this->_cleanUp();
lmbToolkit::restore();
}
示例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();
}
示例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();
}
示例9: tearDown
function tearDown()
{
$this->db->delete('test_db_table');
lmbToolkit::restore();
}
示例10: tearDown
function tearDown()
{
$this->cache_writer->flushAll();
lmbToolkit::restore();
}
示例11: tearDown
function tearDown()
{
lmbToolkit::restore();
lmbFs::rm($this->application_configs_dir);
lmbFs::rm($this->package_configs_dir);
}
示例12: tearDown
function tearDown()
{
$this->locator->clearTestingTemplates();
lmbToolkit::restore();
}
示例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();
}