Speed up some tests.

This commit is contained in:
James Cole
2016-12-22 07:13:37 +01:00
parent 782e2add88
commit e08e7b2c9b
6 changed files with 62 additions and 5 deletions

View File

@@ -8,8 +8,11 @@
*
* See the LICENSE file for details.
*/
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use Illuminate\Pagination\LengthAwarePaginator;
/**
@@ -105,10 +108,18 @@ class AccountControllerTest extends TestCase
public function testShow(string $range)
{
$tasker = $this->mock(\FireflyIII\Repositories\Account\AccountTaskerInterface::class);
$tasker = $this->mock(AccountTaskerInterface::class);
$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
$collector = $this->mock(JournalCollectorInterface::class);
$collector->shouldReceive('setAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('setLimit')->andReturnSelf();
$collector->shouldReceive('setPage')->andReturnSelf();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', route('accounts.show', [1]));