diff options
| author | 2015-02-21 09:42:06 -0500 | |
|---|---|---|
| committer | 2015-02-21 09:46:25 -0500 | |
| commit | 50b6a02578c29c780e6fe36af712bdc7cfe81d3d (patch) | |
| tree | 0416d5164a63ad4a0e4caa1adf689c7cccc7f071 | |
| parent | 115612959302fc51c4720b7a954bf8cbe1b14f3b (diff) | |
Add search default raw value
Before, the default value was undefined. Now it always has a value even when no value is provided.
| -rw-r--r-- | app/Models/Search.php | 2 | ||||
| -rw-r--r-- | tests/app/Models/SearchTest.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/Models/Search.php b/app/Models/Search.php index a22e242af..85340ff13 100644 --- a/app/Models/Search.php +++ b/app/Models/Search.php @@ -11,7 +11,7 @@ require_once(LIB_PATH . '/lib_date.php'); class FreshRSS_Search { // This contains the user input string - private $raw_input; + private $raw_input = ''; // The following properties are extracted from the raw input private $intitle; private $min_date; diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php index 20ea09433..9e3ca6765 100644 --- a/tests/app/Models/SearchTest.php +++ b/tests/app/Models/SearchTest.php @@ -10,7 +10,7 @@ class SearchTest extends \PHPUnit_Framework_TestCase { */ public function test__construct_whenInputIsEmpty_getsOnlyNullValues($input) { $search = new FreshRSS_Search($input); - $this->assertNull($search->getRawInput()); + $this->assertEquals('', $search->getRawInput()); $this->assertNull($search->getIntitle()); $this->assertNull($search->getMinDate()); $this->assertNull($search->getMaxDate()); |
