本文整理汇总了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";
}