本文整理匯總了PHP中SapphireTest::empty_temp_db方法的典型用法代碼示例。如果您正苦於以下問題:PHP SapphireTest::empty_temp_db方法的具體用法?PHP SapphireTest::empty_temp_db怎麽用?PHP SapphireTest::empty_temp_db使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SapphireTest
的用法示例。
在下文中一共展示了SapphireTest::empty_temp_db方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: afterResetDatabase
/**
* @AfterScenario
*/
public function afterResetDatabase(ScenarioEvent $event)
{
\SapphireTest::empty_temp_db();
}
示例2: emptydb
public function emptydb()
{
if (SapphireTest::using_temp_db()) {
SapphireTest::empty_temp_db();
if (isset($_GET['fixture']) && ($fixtureFile = $_GET['fixture'])) {
$fixture = new YamlFixture($fixtureFile);
$fixture->saveIntoDatabase();
return "<p>Re-test the test database with fixture '{$fixtureFile}'. Time to start testing; where would" . " you like to start?</p>";
} else {
return "<p>Re-test the test database. Time to start testing; where would you like to start?</p>";
}
} else {
return "<p>dev/tests/emptydb can only be used with a temporary database. Perhaps you should use" . " dev/tests/startsession first?</p>";
}
}
示例3: clear
public function clear()
{
if (!$this->environment->isRunningTests()) {
throw new LogicException("No test session in progress.");
}
$this->extend('onBeforeClear');
if (SapphireTest::using_temp_db()) {
SapphireTest::empty_temp_db();
}
if (isset($_SESSION['_testsession_codeblocks'])) {
unset($_SESSION['_testsession_codeblocks']);
}
$this->extend('onAfterClear');
return "Cleared database and test state";
}