diff --git a/classes/ComicPressStoryline.inc b/classes/ComicPressStoryline.inc index 2a4a64a..2ec3b00 100644 --- a/classes/ComicPressStoryline.inc +++ b/classes/ComicPressStoryline.inc @@ -413,6 +413,12 @@ class ComicPressStoryline { sort($this->_category_search); return $this; } + + function end_search() { + $result = $this->_category_search; + $this->_category_search = array(); + return $result; + } } ?> \ No newline at end of file diff --git a/test/ComicPressStorylineTest.php b/test/ComicPressStorylineTest.php index c412a3e..f34bae6 100644 --- a/test/ComicPressStorylineTest.php +++ b/test/ComicPressStorylineTest.php @@ -393,6 +393,11 @@ class ComicPressStorylineTest extends PHPUnit_Framework_TestCase { $this->assertEquals(array(5, 6), $css->_category_search); } + function testEndSearch() { + $this->css->_category_search = array(1,2,3); + $this->assertEquals(array(1,2,3), $this->css->end_search()); + $this->assertEquals(array(), $this->css->_category_search); + } } ?> \ No newline at end of file