19 declare(strict_types=1);
21 require_once(
"vendor/composer/vendor/autoload.php");
22 include_once(
"components/ILIAS/UI/tests/Crawler/Fixture/Fixture.php");
31 protected function setUp(): void
33 $this->crawler =
new Crawler\FactoriesCrawler();
42 $entries = $this->crawler->crawlFactory(__DIR__ .
"/Fixture/ComponentsTreeFixture/RootFactory.php");
43 $entries->getEntryById(
"NonExistent")->getChildren();
44 $entries->getParentsOfEntry(
"NonExistent");
45 $this->assertFalse(
"This should not happen");
47 $this->assertEquals(
Crawler\
Exception\CrawlerException::INVALID_ID, $e->getCode());
56 $entries = $this->crawler->crawlFactory(__DIR__ .
"/../../../../../components/ILIAS/UI/tests/Crawler/Fixture/ComponentsTreeFixture/RootFactory.php");
57 $this->assertCount(6, $entries);
60 $entries->getEntryById(
"testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")->getChildren()
64 $entries->getDescendantsOfEntry(
"testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")
68 $entries->getEntryById(
"testsUICrawlerFixtureComponentsTreeFixtureComponent2FactoryComponent2")->getChildren()
72 $entries->getParentsOfEntry(
"testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")
76 $entries->getParentsOfEntry(
"testsUICrawlerFixtureComponentsTreeFixtureComponent1component12component121Component121")
86 $this->crawler->crawlFactory(
"components/ILIAS/UI/tests/Crawler/Fixture/LoopFactory.php");
88 $this->assertFalse(
"This should not happen");
90 $this->assertEquals(
Crawler\
Exception\CrawlerException::CRAWL_MAX_NESTING_REACHED, $e->getCode());
100 $this->crawler->crawlFactory(
"components/ILIAS/UI/tests/Crawler/Fixture/NoNamespaceFactory.php");
101 $this->assertFalse(
"This should not happen");
103 $this->assertEquals(
Crawler\
Exception\CrawlerException::ENTRY_WITH_NO_VALID_RETURN_STATEMENT, $e->getCode());
113 $this->crawler->crawlFactory(
"components/ILIAS/UI/tests/Crawler/Fixture/NoClosingDescriptionFactory.php");
115 $this->assertFalse(
"This should not happen");
117 $this->assertEquals(
Crawler\
Exception\CrawlerException::ENTRY_WITH_NO_YAML_DESCRIPTION, $e->getCode());
Crawler FactoriesCrawler $crawler
testNoClosingDescriptionFactory()