本文整理汇总了PHP中Base::clearDb方法的典型用法代码示例。如果您正苦于以下问题:PHP Base::clearDb方法的具体用法?PHP Base::clearDb怎么用?PHP Base::clearDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base::clearDb方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
Base::clearDb();
}
示例2: InitializeContent
public function InitializeContent()
{
$scope = getURLParam("scope");
if (empty($scope)) {
$this->title = str_format(localize("search.result"), $this->query);
} else {
// Comment to help the perl i18n script
// str_format (localize ("search.result.author"), $this->query)
// str_format (localize ("search.result.tag"), $this->query)
// str_format (localize ("search.result.series"), $this->query)
// str_format (localize ("search.result.book"), $this->query)
// str_format (localize ("search.result.publisher"), $this->query)
$this->title = str_format(localize("search.result.{$scope}"), $this->query);
}
$crit = "%" . $this->query . "%";
// Special case when we are doing a search and no database is selected
if (Base::noDatabaseSelected() && !$this->useTypeahead()) {
$i = 0;
foreach (Base::getDbNameList() as $key) {
Base::clearDb();
list($array, $totalNumber) = Book::getBooksByQuery(array("all" => $crit), 1, $i, 1);
array_push($this->entryArray, new Entry($key, DB . ":query:{$i}", str_format(localize("bookword", $totalNumber), $totalNumber), "text", array(new LinkNavigation("?" . DB . "={$i}&page=9&query=" . $this->query)), "", $totalNumber));
$i++;
}
return;
}
if (empty($scope)) {
$this->doSearchByCategory();
return;
}
$array = $this->searchByScope($scope);
if (count($array) == 2 && is_array($array[0])) {
list($this->entryArray, $this->totalNumber) = $array;
} else {
$this->entryArray = $array;
}
}
示例3: testPageSearch_WithNormalizedSearch_Book
/**
* @dataProvider providerNormalizedSearch
*/
public function testPageSearch_WithNormalizedSearch_Book($query, $count, $content)
{
global $config;
$page = Base::PAGE_OPENSEARCH_QUERY;
$qid = NULL;
$n = "1";
$config['cops_normalized_search'] = "1";
Base::clearDb();
if (!useNormAndUp()) {
$this->markTestIncomplete();
}
$currentPage = Page::getPage($page, $qid, $query, $n);
$currentPage->InitializeContent();
$this->assertEquals("Search result for *{$query}*", $currentPage->title);
$this->assertCount($count, $currentPage->entryArray);
if ($count > 0) {
$this->assertEquals($content, $currentPage->entryArray[0]->content);
}
$this->assertFalse($currentPage->ContainsBook());
$config['cops_normalized_search'] = "0";
Base::clearDb();
}
示例4: testGetURI
public function testGetURI()
{
global $config;
$config['calibre_directory'] = dirname(__FILE__) . "/BaseWithCustomColumns/";
$_GET["custom"] = "11";
$config['cops_calibre_custom_column'] = array("custom_01", "custom_02", "custom_03", "custom_04", "custom_05", "custom_06", "custom_07", "custom_08", "custom_09", "custom_10", "custom_11");
Base::clearDb();
$custom = CustomColumnType::createByLookup("custom_01")->getCustom("1");
$this->assertEquals($custom->customColumnType->getQuery("1"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_02")->getCustom("3");
$this->assertEquals($custom->customColumnType->getQuery("3"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_03")->getCustom("3");
$this->assertEquals($custom->customColumnType->getQuery("3"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_04")->getCustom("4");
$this->assertEquals($custom->customColumnType->getQuery("4"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_05")->getCustom("6");
$this->assertEquals($custom->customColumnType->getQuery("6"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_06")->getCustom("2016-04-24");
$this->assertEquals($custom->customColumnType->getQuery("2016-04-24"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_07")->getCustom("11.0");
$this->assertEquals($custom->customColumnType->getQuery("11.0"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_08")->getCustom("-2");
$this->assertEquals($custom->customColumnType->getQuery("-2"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_09")->getCustom("0");
$this->assertEquals($custom->customColumnType->getQuery("0"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_09")->getCustom("1");
$this->assertEquals($custom->customColumnType->getQuery("1"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_10")->getCustom("-1");
$this->assertEquals($custom->customColumnType->getQuery("-1"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_10")->getCustom("0");
$this->assertEquals($custom->customColumnType->getQuery("0"), $custom->getQuery());
$custom = CustomColumnType::createByLookup("custom_10")->getCustom("1");
$this->assertEquals($custom->customColumnType->getQuery("1"), $custom->getQuery());
$_GET["custom"] = NULL;
$config['cops_calibre_custom_column'] = array();
$config['calibre_directory'] = dirname(__FILE__) . "/BaseWithSomeBooks/";
Base::clearDb();
}
示例5: tearDownAfterClass
public static function tearDownAfterClass()
{
Base::clearDb();
}