Expand tests, do code cleanup.

This commit is contained in:
James Cole
2017-12-17 14:30:53 +01:00
parent b08af77c98
commit 78335e5814
141 changed files with 773 additions and 54 deletions

View File

@@ -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);
}
}