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

@@ -53,9 +53,9 @@ class IndexControllerTest extends TestCase
public function testIndex(): void
{
$this->mockDefaultSession();
$group = $this->getRandomWithdrawalGroup();
$userRepos = $this->mock(UserRepositoryInterface::class);
$collector = $this->mock(GroupCollectorInterface::class);
$group = $this->getRandomWithdrawalGroup();
$userRepos = $this->mock(UserRepositoryInterface::class);
$collector = $this->mock(GroupCollectorInterface::class);
// generic set for the info blocks:
$groupArray = [$this->getRandomWithdrawalAsArray()];
@@ -95,9 +95,9 @@ class IndexControllerTest extends TestCase
public function testIndexAll(): void
{
$this->mockDefaultSession();
$group = $this->getRandomWithdrawalGroup();
$userRepos = $this->mock(UserRepositoryInterface::class);
$collector = $this->mock(GroupCollectorInterface::class);
$group = $this->getRandomWithdrawalGroup();
$userRepos = $this->mock(UserRepositoryInterface::class);
$collector = $this->mock(GroupCollectorInterface::class);
// role?
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->andReturn(true);