mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 17:33:45 +00:00
First set of new tests.
This commit is contained in:
@@ -16,4 +16,23 @@ use Tests\TestCase;
|
||||
class SearchControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\SearchController::index
|
||||
* Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
$search = $this->mock(SearchInterface::class);
|
||||
$search->shouldReceive('setLimit')->once();
|
||||
$search->shouldReceive('searchTransactions')->andReturn(new Collection)->withArgs([['test']])->once();
|
||||
$search->shouldReceive('searchBudgets')->andReturn(new Collection)->withArgs([['test']])->once();
|
||||
$search->shouldReceive('searchTags')->andReturn(new Collection)->withArgs([['test']])->once();
|
||||
$search->shouldReceive('searchCategories')->andReturn(new Collection)->withArgs([['test']])->once();
|
||||
$search->shouldReceive('searchAccounts')->andReturn(new Collection)->withArgs([['test']])->once();
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('search.index') . '?q=test');
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user