merge: tool groups with inherited mode and 'nur lesen' per group
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,28 @@ final class IntegrationRegistryTest extends TestCase
|
||||
self::assertSame([$direct, $indirect], $registry->abilities());
|
||||
}
|
||||
|
||||
public function testGroupsAbilitiesByIntegrationIdAndMapsNamesToGroups(): void
|
||||
{
|
||||
$guide = $this->ability('lit/guide', true);
|
||||
$outline = $this->ability('lit/divi-outline', true);
|
||||
$hidden = $this->ability('lit/pods-x', true);
|
||||
$divi = Mockery::mock(Integration::class);
|
||||
$divi->allows('id')->andReturn('divi');
|
||||
$divi->allows('isAvailable')->andReturn(true);
|
||||
$divi->expects('abilities')->once()->andReturn([$outline]);
|
||||
|
||||
$registry = new IntegrationRegistry(
|
||||
$this->integration('core', true, [$guide]),
|
||||
$divi,
|
||||
$this->integration('pods', false, [$hidden])
|
||||
);
|
||||
|
||||
self::assertSame([$guide, $outline], $registry->abilities());
|
||||
self::assertSame(['core' => [$guide], 'divi' => [$outline]], $registry->grouped());
|
||||
self::assertSame(['lit/guide' => 'core', 'lit/divi-outline' => 'divi'], $registry->groupMap());
|
||||
self::assertSame(['core', 'divi', 'pods'], $registry->ids());
|
||||
}
|
||||
|
||||
private function ability(string $name, bool $direct): Ability
|
||||
{
|
||||
$ability = Mockery::mock(Ability::class);
|
||||
|
||||
Reference in New Issue
Block a user