Fix tenant SSO status mode and refactor status UI tiles
This commit is contained in:
@@ -159,6 +159,48 @@ class TenantSsoServiceTest extends TestCase
|
||||
$this->assertSame('sso_disabled', $result['microsoft_reason']);
|
||||
}
|
||||
|
||||
public function testBuildMicrosoftUiStateReturnsLocalOnlyPasswordModeWhenSsoDisabled(): void
|
||||
{
|
||||
$repository = $this->createMock(TenantMicrosoftAuthRepositoryInterface::class);
|
||||
$repository->method('findByTenantId')->willReturn([
|
||||
'enabled' => 0,
|
||||
'enforce_microsoft_login' => 1,
|
||||
]);
|
||||
|
||||
$service = $this->newService($repository);
|
||||
$result = $service->buildMicrosoftUiState(5);
|
||||
|
||||
$this->assertSame('local_only', $result['password_mode']);
|
||||
}
|
||||
|
||||
public function testBuildMicrosoftUiStateReturnsLocalAndMicrosoftPasswordModeWhenSsoEnabledWithoutEnforcement(): void
|
||||
{
|
||||
$repository = $this->createMock(TenantMicrosoftAuthRepositoryInterface::class);
|
||||
$repository->method('findByTenantId')->willReturn([
|
||||
'enabled' => 1,
|
||||
'enforce_microsoft_login' => 0,
|
||||
]);
|
||||
|
||||
$service = $this->newService($repository);
|
||||
$result = $service->buildMicrosoftUiState(5);
|
||||
|
||||
$this->assertSame('local_and_microsoft', $result['password_mode']);
|
||||
}
|
||||
|
||||
public function testBuildMicrosoftUiStateReturnsMicrosoftOnlyPasswordModeWhenEnforced(): void
|
||||
{
|
||||
$repository = $this->createMock(TenantMicrosoftAuthRepositoryInterface::class);
|
||||
$repository->method('findByTenantId')->willReturn([
|
||||
'enabled' => 1,
|
||||
'enforce_microsoft_login' => 1,
|
||||
]);
|
||||
|
||||
$service = $this->newService($repository);
|
||||
$result = $service->buildMicrosoftUiState(5);
|
||||
|
||||
$this->assertSame('microsoft_only', $result['password_mode']);
|
||||
}
|
||||
|
||||
public function testResolveTenantLoginMethodsReturnsMicrosoftOnlyWhenEnforcedAndConfigured(): void
|
||||
{
|
||||
$tenantGateway = $this->createMock(AuthTenantGateway::class);
|
||||
|
||||
Reference in New Issue
Block a user