Files
firefly-iii/tests/acceptance/Controllers/SearchControllerTest.php
2016-12-19 20:21:14 +01:00

50 lines
1.6 KiB
PHP

<?php
/**
* SearchControllerTest.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
use FireflyIII\Support\Search\SearchInterface;
use Illuminate\Support\Collection;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:43.
*/
class SearchControllerTest extends TestCase
{
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
public function setUp()
{
parent::setUp();
}
/**
* @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());
$this->call('get', route('search.index') . '?q=test');
$this->assertResponseStatus(200);
$this->see('<ol class="breadcrumb">');
}
}