From b2198c25c247a0bb5bd25d97812b2a522dabdb86 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 5 Nov 2009 22:32:32 -0500 Subject: [PATCH] end category searches --- classes/ComicPressStoryline.inc | 6 ++++++ test/ComicPressStorylineTest.php | 5 +++++ 2 files changed, 11 insertions(+) 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