diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-19 21:12:17 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-19 21:12:17 -0400 |
commit | 1983fc5f7afa20b5ddba0ad1fb63fb92f563deb6 (patch) | |
tree | 1e81a44c631b0144b24c4548c3cdd8630657ac3e /tests | |
parent | 57bd53847cfd01d414728c871512ef2af123ffd5 (diff) |
Show all tasks when using no search criteria
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/TaskFilterTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/units/TaskFilterTest.php b/tests/units/TaskFilterTest.php index 5f606d7a..504aa5c2 100644 --- a/tests/units/TaskFilterTest.php +++ b/tests/units/TaskFilterTest.php @@ -80,6 +80,24 @@ class TaskFilterTest extends Base $this->assertEmpty($tf->search('search something')->findAll()); } + public function testSearchWithEmptyInput() + { + $dp = new DateParser($this->container); + $p = new Project($this->container); + $tc = new TaskCreation($this->container); + $tf = new TaskFilter($this->container); + + $this->assertEquals(1, $p->create(array('name' => 'test'))); + $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'my task title is awesome', 'date_due' => $dp->getTimestampFromIsoFormat('-2 days')))); + $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'my task title is amazing', 'date_due' => $dp->getTimestampFromIsoFormat('+1 day')))); + $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'Bob at work', 'date_due' => $dp->getTimestampFromIsoFormat('-1 day')))); + $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'youpi', 'date_due' => $dp->getTimestampFromIsoFormat(time())))); + + $result = $tf->search('')->findAll(); + $this->assertNotEmpty($result); + $this->assertCount(4, $result); + } + public function testSearchById() { $p = new Project($this->container); |