fix: Task 5 review round 1 - restore point inside the kses window, strict map field types (S37)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,4 +46,14 @@ final class WpValueSanitizerTest extends TestCase
|
||||
self::assertSame('Hallo', $sanitizer->text('<b>Hallo</b>'));
|
||||
self::assertSame('url(https://x.test/a b)', $sanitizer->url(' https://x.test/a b '));
|
||||
}
|
||||
|
||||
public function testCanReadPostAsksWordPress(): void
|
||||
{
|
||||
Functions\when('current_user_can')->alias(static fn (string $cap, int $id = 0): bool => $cap === 'read_post' && $id === 12);
|
||||
$sanitizer = new WpValueSanitizer();
|
||||
|
||||
self::assertTrue($sanitizer->canReadPost(12));
|
||||
self::assertFalse($sanitizer->canReadPost(13));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user