From 250a8e57f8701d3b8d0a8b8d20bf86f324d6619d Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 11 Dec 2019 16:56:38 -0500
Subject: [PATCH] Add test.

---
 .../src/VuFindTest/Search/HistoryTest.php        | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/HistoryTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/HistoryTest.php
index f03094c8b8e..f8eaa45234f 100644
--- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/HistoryTest.php
+++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/HistoryTest.php
@@ -94,6 +94,22 @@ class HistoryTest extends TestCase
         );
     }
 
+    /**
+     * Test that purging history proxies to the right place.
+     *
+     * @return void
+     */
+    public function testPurgeHistory()
+    {
+        $table = $this->getMockBuilder(\VuFind\Db\Table\Search::class)
+            ->disableOriginalConstructor()->setMethods(['destroySession'])
+            ->getMock();
+        $table->expects($this->once())->method('destroySession')
+            ->with($this->equalTo('foosession'), $this->equalTo(1234));
+        $history = $this->getHistory($table);
+        $history->purgeSearchHistory(1234);
+    }
+
     /**
      * Get object for testing.
      *
-- 
GitLab