bisschen tests fixen

This commit is contained in:
2026-02-23 16:00:04 +01:00
parent 99db252f60
commit 7b53faca37
5 changed files with 43 additions and 41 deletions

View File

@@ -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])

View File

@@ -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([]);

View File

@@ -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)