ability = new GuideAbility(new GuideRepository(dirname(__DIR__, 3) . '/Fixtures/guides')); } public function testWithoutTopicReturnsOverviewAndTopicList(): void { $result = $this->ability->execute([]); self::assertSame('overview', $result['topic']); self::assertSame(['divi-shortform', 'overview'], $result['topics']); self::assertStringContainsString('Testinhalt Übersicht', $result['content']); } public function testReturnsRequestedTopic(): void { $result = $this->ability->execute(['topic' => 'divi-shortform']); self::assertStringContainsString('Testinhalt Kurzform', $result['content']); } public function testUnknownTopicIsNotFoundErrorListingTopics(): void { $result = $this->ability->execute(['topic' => '../../wp-config']); self::assertInstanceOf(WP_Error::class, $result); self::assertSame('lit_not_found', $result->get_error_code()); self::assertStringContainsString('divi-shortform', $result->get_error_message()); } public function testIsDirectReadOnlyTool(): void { self::assertSame('lit/guide', $this->ability->name()); self::assertTrue($this->ability->isDirect()); self::assertTrue($this->ability->annotations()['readonly']); } }