chore: uuid string guard in revoke, docblock placement, stricter schedule warning test

This commit is contained in:
2026-09-26 05:07:35 +02:00
parent 6ed63ec008
commit 50f0f98c8e
5 changed files with 22 additions and 6 deletions
+13
View File
@@ -145,6 +145,19 @@ final class AccessTabTest extends TestCase
}))->handleRevoke();
}
public function testRevokeTreatsANonStringUuidAsMissing(): void
{
$_POST = ['user_id' => '3', 'uuid' => ['uuid-1']];
Functions\when('current_user_can')->justReturn(true);
Functions\expect('check_admin_referer')->once()->with('lit_mcp_revoke_');
$connections = Mockery::mock(ConnectionRepository::class);
$connections->expects('revoke')->with(3, '')->andReturn(false);
Functions\when('wp_safe_redirect')->justReturn(true);
(new AccessTab(new Access(), $connections, static function (): void {
}))->handleRevoke();
}
public function testRevokeRequiresManageOptions(): void
{
$_POST = ['user_id' => '3', 'uuid' => 'uuid-1'];
@@ -65,7 +65,7 @@ final class PostScheduleAbilityTest extends TestCase
$result = $this->ability($log)->execute(['post_id' => 5, 'date' => '2099-06-01 09:30']);
self::assertCount(1, $result['warnings']);
self::assertStringContainsString('öffentlich', $result['warnings'][0]);
self::assertStringContainsString('ÖFFENTLICH', $result['warnings'][0]);
self::assertStringContainsString('2099-06-01 09:30', $result['warnings'][0]);
}