mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Expand tests, do code cleanup.
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
namespace Tests\Feature\Controllers;
|
||||
|
||||
use FireflyIII\Support\Search\SearchInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
@@ -48,4 +49,21 @@ class SearchControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\SearchController::search
|
||||
* @covers \FireflyIII\Http\Controllers\SearchController::__construct
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$search = $this->mock(SearchInterface::class);
|
||||
$search->shouldReceive('parseQuery')->once();
|
||||
$search->shouldReceive('setLimit')->withArgs([50])->once();
|
||||
$search->shouldReceive('searchTransactions')->once()->andReturn(new Collection);
|
||||
|
||||
$this->be($this->user());
|
||||
|
||||
$response = $this->get(route('search.search') . '?query=test');
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user