summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-09-27 20:44:29 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2010-09-27 20:44:29 +0000
commitab618a8908382634ba9aa14a1df69f217807bc04 (patch)
treeb98346a0c1c0293d6a8b903e573f9765aa4bdaf3
parentf0456530b4940918efba25ea15e22532c682fb70 (diff)
downloadsemanticscuttle-ab618a8908382634ba9aa14a1df69f217807bc04.tar.gz
semanticscuttle-ab618a8908382634ba9aa14a1df69f217807bc04.tar.bz2
test deleteall in searchhistory
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@758 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--tests/SearchHistoryTest.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/SearchHistoryTest.php b/tests/SearchHistoryTest.php
index 53d0451..ed353b9 100644
--- a/tests/SearchHistoryTest.php
+++ b/tests/SearchHistoryTest.php
@@ -12,13 +12,12 @@
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once 'prepare.php';
-
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'SearchHistoryTest::main');
}
+require_once 'prepare.php';
+
/**
* Unit tests for the SemanticScuttle search history service.
*
@@ -190,6 +189,8 @@ class SearchHistoryTest extends TestBase
$this->shs->deleteOldestSearch();
+ $this->assertEquals(1, $this->shs->countSearches());
+
$rows = $this->shs->getAllSearches();
$this->assertEquals(1, count($rows));
$this->assertEquals(
@@ -197,6 +198,19 @@ class SearchHistoryTest extends TestBase
$rows[0]['shId']
);
}
+
+
+
+ /**
+ * Test deleting all of the search history
+ */
+ public function testDeleteAll()
+ {
+ $this->shs->addSearch('testsearchterm1', 'all', 0);
+ $this->shs->addSearch('testsearchterm2', 'all', 0);
+ $this->shs->deleteAll();
+ $this->assertEquals(0, $this->shs->countSearches());
+ }
}