From 30e3ed64109e997ab58ef5980707d9782245bbdf Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 6 Apr 2016 20:52:22 +0200 Subject: [PATCH] Fix more tests. --- app/Repositories/Tag/TagRepository.php | 2 +- tests/acceptance/Controllers/CsvControllerTest.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 32c3ddcfc1..14fea48a91 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -86,7 +86,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - public function connect(TransactionJournal $journal, Tag $tag): Collection + public function connect(TransactionJournal $journal, Tag $tag): bool { /* * Already connected: diff --git a/tests/acceptance/Controllers/CsvControllerTest.php b/tests/acceptance/Controllers/CsvControllerTest.php index 6f1e98fe13..433b52a167 100644 --- a/tests/acceptance/Controllers/CsvControllerTest.php +++ b/tests/acceptance/Controllers/CsvControllerTest.php @@ -6,6 +6,7 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ +use Illuminate\Support\Collection; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -177,10 +178,10 @@ class CsvControllerTest extends TestCase $importer->shouldReceive('setData')->once()->with($data); $importer->shouldReceive('run')->once()->withNoArgs(); - $importer->shouldReceive('getRows')->once()->withNoArgs(); - $importer->shouldReceive('getErrors')->once()->withNoArgs(); - $importer->shouldReceive('getImported')->once()->withNoArgs(); - $importer->shouldReceive('getJournals')->once()->withNoArgs(); + $importer->shouldReceive('getRows')->once()->withNoArgs()->andReturn(0); + $importer->shouldReceive('getErrors')->once()->withNoArgs()->andReturn([]); + $importer->shouldReceive('getImported')->once()->withNoArgs()->andReturn(0); + $importer->shouldReceive('getJournals')->once()->withNoArgs()->andReturn(new Collection); $this->call('GET', '/csv/process'); $this->assertResponseStatus(200);