當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Base::clearDb方法代碼示例

本文整理匯總了PHP中Base::clearDb方法的典型用法代碼示例。如果您正苦於以下問題:PHP Base::clearDb方法的具體用法?PHP Base::clearDb怎麽用?PHP Base::clearDb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Base的用法示例。


在下文中一共展示了Base::clearDb方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 public function tearDown()
 {
     Base::clearDb();
 }
開發者ID:horus68,項目名稱:cops,代碼行數:4,代碼來源:bookTest.php

示例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;
     }
 }
開發者ID:Klemart3D,項目名稱:COPS,代碼行數:37,代碼來源:base.php

示例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();
 }
開發者ID:BreizhCat,項目名稱:cops,代碼行數:25,代碼來源:pageTest.php

示例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();
 }
開發者ID:horus68,項目名稱:cops,代碼行數:38,代碼來源:customColumnsTest.php

示例5: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     Base::clearDb();
 }
開發者ID:BreizhCat,項目名稱:cops,代碼行數:4,代碼來源:pageMultidatabaseTest.php


注:本文中的Base::clearDb方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。