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

@@ -111,15 +111,11 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</div>
<div data-tab-panel="master-data">
<details name="general" open data-details-always-open>
<summary><?php e(t('General')); ?></summary>
<hr>
<label class="app-field">
<span><?php e(t('App title')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
<input type="text" name="app_title" value="<?php e($appTitle); ?>" placeholder="<?php e(appTitle()); ?>" <?php e($readonlyAttr); ?>>
<small><?php e(t($appTitleDesc)); ?></small>
</label>
</details>
<label class="app-field">
<span><?php e(t('App title')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
<input type="text" name="app_title" value="<?php e($appTitle); ?>" placeholder="<?php e(appTitle()); ?>" <?php e($readonlyAttr); ?>>
<small><?php e(t($appTitleDesc)); ?></small>
</label>
<hr>
<details name="internationalization" data-details-key="internationalization">
<summary><?php e(t('Internationalization')); ?></summary>
@@ -193,7 +189,6 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</small>
</label>
</div>
<label class="app-field">
<span><?php e(t('Default role')); ?></span>
<select name="default_role_id" <?php e($disabledAttr); ?>>
@@ -259,10 +254,7 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</div>
<div data-tab-panel="security">
<details name="security" open>
<summary><?php e(t('Security')); ?></summary>
<hr>
<fieldset>
<fieldset>
<legend>
<small>
<?php e(t($appRegistrationDesc)); ?>
@@ -306,14 +298,10 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</button>
<?php endif; ?>
</fieldset>
</details>
</div>
<div data-tab-panel="email">
<details name="smtp" open>
<summary><?php e(t('Email settings')); ?></summary>
<hr>
<div class="grid">
<div class="grid">
<label class="app-field">
<span><?php e(t('SMTP host')); ?></span>
<input type="text" name="smtp_host" value="<?php e($smtpHost); ?>" <?php e($readonlyAttr); ?>>
@@ -358,14 +346,10 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
<input type="text" name="smtp_from_name" value="<?php e($smtpFromName); ?>" <?php e($readonlyAttr); ?>>
<small><?php e(t($smtpFromNameDesc)); ?></small>
</label>
</details>
</div>
<div data-tab-panel="api">
<details name="api-settings" open>
<summary><?php e(t('API settings')); ?></summary>
<hr>
<p class="muted"><?php e(t('API tokens and default lifetimes are managed here.')); ?></p>
<p class="muted"><?php e(t('API tokens and default lifetimes are managed here.')); ?></p>
<div class="grid">
<label class="app-field">
<span><?php e(t('API token default lifetime (days)')); ?> <span class="badge" data-variant="info"><?php e(t('Cached')); ?></span></span>
@@ -399,14 +383,10 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</button>
</fieldset>
<?php endif; ?>
</details>
</div>
<div data-tab-panel="integrations">
<details name="microsoft-sso" open>
<summary><?php e(t('Microsoft SSO')); ?></summary>
<hr>
<blockquote data-variant="info">
<blockquote data-variant="info">
<?php e(t('Shared Microsoft app credentials are used by tenants that enable "Use shared app credentials".')); ?>
</blockquote>
<label class="app-field">
@@ -424,15 +404,11 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
<input type="url" name="microsoft_authority" value="<?php e($microsoftAuthority); ?>" placeholder="https://login.microsoftonline.com/common/v2.0" <?php e($readonlyAttr); ?>>
<small><?php e(t($microsoftAuthorityDesc)); ?></small>
</label>
</details>
</div>
<?php if ($canUpdateSettings): ?>
<div data-tab-panel="danger">
<details name="danger-zone" open>
<summary><?php e(t('Danger zone')); ?></summary>
<hr>
<fieldset>
<fieldset>
<legend><small><?php e(t('Login tokens')); ?></small></legend>
<p class="muted">
<?php e(t('This will mark all remember-me tokens as expired. Users will need to sign in again.')); ?>
@@ -448,7 +424,6 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
<?php Session::getCsrfInput(); ?>
</form>
</fieldset>
</details>
</div>
<?php endif; ?>
</div>

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)

View File

@@ -111,10 +111,36 @@
color: var(--app-color);
}
/* Reset all Pico CSS button styles that bleed into Swagger UI */
.swagger-ui button {
cursor: pointer;
background: transparent;
border: 0;
padding: 0;
margin: 0;
color: inherit;
font-size: inherit;
font-weight: inherit;
font-family: inherit;
line-height: inherit;
border-radius: 0;
box-shadow: none;
text-transform: none;
/* Reset CSS custom properties set by app base styles on all buttons */
--app-background-color: initial;
--app-border-color: initial;
--app-color: initial;
--app-box-shadow: initial;
}
/* Restore sizing/appearance for Swagger UI action buttons (.btn) */
.swagger-ui .btn {
padding: 6px 23px;
font-size: 14px;
font-weight: 700;
border: 2px solid transparent;
border-radius: var(--app-border-radius);
background: transparent;
}
.swagger-ui .opblock .opblock-summary-description {