fix: library entries read as not found without the library right (P12)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,10 +66,17 @@ final class DiviIntegrationTest extends TestCase
|
||||
$schema->allows('isManaged')->andReturn(false);
|
||||
$outline = static fn (DiviIntegration $divi): mixed => $divi->abilities()[0]->permission(['post_id' => 1055]);
|
||||
|
||||
// No Divi in unit tests: DiviRoles allows nothing, so a reachable entry is refused, not missing.
|
||||
$visible = new DiviIntegration($schema, FakeChangeLog::forbidden(), null, static fn (): bool => true);
|
||||
self::assertToolError($outline($visible), 'forbidden');
|
||||
self::assertToolError($outline(new DiviIntegration($schema, FakeChangeLog::forbidden())), 'forbidden');
|
||||
// No Divi in unit tests: DiviRoles allows nothing, so the entry is not found either way (ruling P12);
|
||||
// the wiring shows in which gate the integration asks.
|
||||
$asked = 0;
|
||||
$visible = new DiviIntegration($schema, FakeChangeLog::forbidden(), null, static function () use (&$asked): bool {
|
||||
++$asked;
|
||||
|
||||
return true;
|
||||
});
|
||||
self::assertToolError($outline($visible), 'not_found');
|
||||
self::assertSame(1, $asked);
|
||||
self::assertToolError($outline(new DiviIntegration($schema, FakeChangeLog::forbidden())), 'not_found');
|
||||
|
||||
$hidden = new DiviIntegration($schema, FakeChangeLog::forbidden(), libraryVisible: static fn (): bool => false);
|
||||
$refusal = $outline($hidden);
|
||||
|
||||
Reference in New Issue
Block a user