Improve test coverage.

This commit is contained in:
James Cole
2019-07-25 14:19:49 +02:00
parent ee95606ec0
commit 6ff4a0b45c
61 changed files with 822 additions and 599 deletions

View File

@@ -25,7 +25,6 @@ namespace Tests\Feature\Controllers\Transaction;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionJournalLink;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Collection;
@@ -60,8 +59,6 @@ class LinkControllerTest extends TestCase
$userRepos = $this->mock(UserRepositoryInterface::class);
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);
$this->be($this->user());
@@ -80,7 +77,6 @@ class LinkControllerTest extends TestCase
$linkRepos = $this->mock(LinkTypeRepositoryInterface::class);
$linkRepos->shouldReceive('get')->atLeast()->once()->andReturn(new Collection);
$this->be($this->user());
@@ -94,8 +90,8 @@ class LinkControllerTest extends TestCase
public function testDestroy(): void
{
$this->mockDefaultSession();
$link = $this->getRandomLink();
$repository = $this->mock(LinkTypeRepositoryInterface::class);
$link = $this->getRandomLink();
$repository = $this->mock(LinkTypeRepositoryInterface::class);
Preferences::shouldReceive('mark')->once();
@@ -203,7 +199,7 @@ class LinkControllerTest extends TestCase
$repository = $this->mock(LinkTypeRepositoryInterface::class);
$journalRepos = $this->mockDefaultSession();
$data = [
$data = [
'link_other' => $withdrawal->id,
'link_type' => '1_inward',
];
@@ -224,8 +220,8 @@ class LinkControllerTest extends TestCase
public function testSwitchLink(): void
{
$this->mockDefaultSession();
$link = $this->getRandomLink();
$repository = $this->mock(LinkTypeRepositoryInterface::class);
$link = $this->getRandomLink();
$repository = $this->mock(LinkTypeRepositoryInterface::class);
$this->mock(UserRepositoryInterface::class);