From f560fc6d76d37d545dd2c1b5da1c03dd12fbd156 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 3 May 2015 15:55:19 +0200 Subject: [PATCH] Covered search controller. --- tests/controllers/SearchControllerTest.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tests/controllers/SearchControllerTest.php diff --git a/tests/controllers/SearchControllerTest.php b/tests/controllers/SearchControllerTest.php new file mode 100644 index 0000000000..c4478c342f --- /dev/null +++ b/tests/controllers/SearchControllerTest.php @@ -0,0 +1,56 @@ +be($user); + $words = ['Something']; + // mock! + $repository = $this->mock('FireflyIII\Support\Search\SearchInterface'); + $repository->shouldReceive('searchTransactions')->with($words)->once()->andReturn([]); + $repository->shouldReceive('searchAccounts')->with($words)->once()->andReturn([]); + $repository->shouldReceive('searchCategories')->with($words)->once()->andReturn([]); + $repository->shouldReceive('searchBudgets')->with($words)->once()->andReturn([]); + $repository->shouldReceive('searchTags')->with($words)->once()->andReturn([]); + + $this->call('GET','/search?q=Something'); + $this->assertResponseOk(); + } +} \ No newline at end of file