bisschen tests fixen
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
namespace MintyPHP\Tests\Service\Access;
|
||||
|
||||
use MintyPHP\Service\Access\PermissionGateway;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PermissionGatewayTest extends TestCase
|
||||
{
|
||||
public function testUserHasDelegatesToService(): void
|
||||
{
|
||||
$permissionService = $this->createMock('MintyPHP\\Service\\Access\\PermissionService');
|
||||
$permissionService = $this->createMock(PermissionService::class);
|
||||
$permissionService->expects($this->once())
|
||||
->method('userHas')
|
||||
->with(7, 'users.view')
|
||||
@@ -21,7 +22,7 @@ class PermissionGatewayTest extends TestCase
|
||||
|
||||
public function testListPagedDelegatesToService(): void
|
||||
{
|
||||
$permissionService = $this->createMock('MintyPHP\\Service\\Access\\PermissionService');
|
||||
$permissionService = $this->createMock(PermissionService::class);
|
||||
$permissionService->expects($this->once())
|
||||
->method('listPaged')
|
||||
->with(['limit' => 10])
|
||||
|
||||
@@ -120,8 +120,7 @@ class ImportServiceTest extends TestCase
|
||||
$stateStore = $stateStore ?? $this->createMock(ImportStateStoreService::class);
|
||||
$permissionGateway = $this->createMock(PermissionGateway::class);
|
||||
$permissionGateway->method('userHas')->willReturn(false);
|
||||
$settingService = $this->createMock('MintyPHP\\Service\\Settings\\SettingService');
|
||||
$settingGateway = new SettingGateway($settingService);
|
||||
$settingGateway = $this->createMock(SettingGateway::class);
|
||||
$userScopeGateway = $this->createMock(UserScopeGateway::class);
|
||||
$userScopeGateway->method('hasGlobalAccess')->willReturn(false);
|
||||
$userScopeGateway->method('getUserTenantIds')->willReturn([]);
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
namespace MintyPHP\Tests\Service\Settings;
|
||||
|
||||
use MintyPHP\Service\Settings\SettingGateway;
|
||||
use MintyPHP\Service\Settings\SettingService;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SettingGatewayTest extends TestCase
|
||||
{
|
||||
public function testGetDefaultTenantIdDelegatesToService(): void
|
||||
{
|
||||
$settingService = $this->createMock('MintyPHP\\Service\\Settings\\SettingService');
|
||||
$settingService = $this->createMock(SettingService::class);
|
||||
$settingService->expects($this->once())
|
||||
->method('getDefaultTenantId')
|
||||
->willReturn(42);
|
||||
@@ -20,7 +21,7 @@ class SettingGatewayTest extends TestCase
|
||||
|
||||
public function testSetDefaultRoleIdDelegatesToService(): void
|
||||
{
|
||||
$settingService = $this->createMock('MintyPHP\\Service\\Settings\\SettingService');
|
||||
$settingService = $this->createMock(SettingService::class);
|
||||
$settingService->expects($this->once())
|
||||
->method('setDefaultRoleId')
|
||||
->with(7, null)
|
||||
|
||||
Reference in New Issue
Block a user