Various code coverage changes and code updates.

This commit is contained in:
James Cole
2018-07-12 21:32:58 +02:00
parent 0217d9396a
commit 5846431b34
20 changed files with 398 additions and 224 deletions

View File

@@ -92,6 +92,8 @@ class UserEventHandlerTest extends TestCase
$listener = new UserEventHandler();
// mock stuff
$repository->shouldReceive('hasRole')->once()->andReturn(false);
$repository->shouldReceive('count')->once()->andReturn(1);
$repository->shouldReceive('getRole')->once()->andReturn(null);
$repository->shouldReceive('attachRole')->once()->withArgs([Mockery::any(), 'owner']);
@@ -112,6 +114,7 @@ class UserEventHandlerTest extends TestCase
$listener = new UserEventHandler();
// mock stuff
$repository->shouldReceive('hasRole')->once()->andReturn(false);
$repository->shouldReceive('count')->once()->andReturn(1);
$repository->shouldReceive('getRole')->once()->andReturn(new Role);
$repository->shouldReceive('attachRole')->once()->withArgs([Mockery::any(), 'owner']);
@@ -131,6 +134,7 @@ class UserEventHandlerTest extends TestCase
$listener = new UserEventHandler();
// mock stuff
$repository->shouldReceive('hasRole')->once()->andReturn(true);
$repository->shouldReceive('count')->once()->andReturn(1);
$listener->checkSingleUserIsAdmin($event);