소스 검색

Add search default raw value

Before, the default value was undefined. Now it always has a value even when no value is provided.
Alexis Degrugillier 11 년 전
부모
커밋
50b6a02578
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/Models/Search.php
  2. 1 1
      tests/app/Models/SearchTest.php

+ 1 - 1
app/Models/Search.php

@@ -11,7 +11,7 @@ require_once(LIB_PATH . '/lib_date.php');
 class FreshRSS_Search {
 class FreshRSS_Search {
 
 
 	// This contains the user input string
 	// This contains the user input string
-	private $raw_input;
+	private $raw_input = '';
 	// The following properties are extracted from the raw input
 	// The following properties are extracted from the raw input
 	private $intitle;
 	private $intitle;
 	private $min_date;
 	private $min_date;

+ 1 - 1
tests/app/Models/SearchTest.php

@@ -10,7 +10,7 @@ class SearchTest extends \PHPUnit_Framework_TestCase {
 	 */
 	 */
 	public function test__construct_whenInputIsEmpty_getsOnlyNullValues($input) {
 	public function test__construct_whenInputIsEmpty_getsOnlyNullValues($input) {
 		$search = new FreshRSS_Search($input);
 		$search = new FreshRSS_Search($input);
-		$this->assertNull($search->getRawInput());
+		$this->assertEquals('', $search->getRawInput());
 		$this->assertNull($search->getIntitle());
 		$this->assertNull($search->getIntitle());
 		$this->assertNull($search->getMinDate());
 		$this->assertNull($search->getMinDate());
 		$this->assertNull($search->getMaxDate());
 		$this->assertNull($search->getMaxDate());