ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
FactoriesCrawlerTest Class Reference
+ Inheritance diagram for FactoriesCrawlerTest:
+ Collaboration diagram for FactoriesCrawlerTest:

Public Member Functions

 testAccessInvalidEntry ()
 
 testParseValidFile ()
 
 testLoopFactory ()
 
 testNoNamespaceFactory ()
 
 testNoClosingDescriptionFactory ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

Crawler FactoriesCrawler $crawler
 

Detailed Description

Definition at line 27 of file FactoriesCrawlerTest.php.

Member Function Documentation

◆ setUp()

FactoriesCrawlerTest::setUp ( )
protected

Definition at line 31 of file FactoriesCrawlerTest.php.

31  : void
32  {
33  $this->crawler = new Crawler\FactoriesCrawler();
34  }

◆ testAccessInvalidEntry()

FactoriesCrawlerTest::testAccessInvalidEntry ( )
Exceptions
Crawler

Definition at line 39 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

39  : void
40  {
41  try {
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());
48  }
49  }

◆ testLoopFactory()

FactoriesCrawlerTest::testLoopFactory ( )
Exceptions
Crawler

Definition at line 83 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

83  : void
84  {
85  try {
86  $this->crawler->crawlFactory("components/ILIAS/UI/tests/Crawler/Fixture/LoopFactory.php");
87 
88  $this->assertFalse("This should not happen");
90  $this->assertEquals(Crawler\Exception\CrawlerException::CRAWL_MAX_NESTING_REACHED, $e->getCode());
91  }
92  }

◆ testNoClosingDescriptionFactory()

FactoriesCrawlerTest::testNoClosingDescriptionFactory ( )
Exceptions
Crawler

Definition at line 110 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

110  : void
111  {
112  try {
113  $this->crawler->crawlFactory("components/ILIAS/UI/tests/Crawler/Fixture/NoClosingDescriptionFactory.php");
114 
115  $this->assertFalse("This should not happen");
117  $this->assertEquals(Crawler\Exception\CrawlerException::ENTRY_WITH_NO_YAML_DESCRIPTION, $e->getCode());
118  }
119  }

◆ testNoNamespaceFactory()

FactoriesCrawlerTest::testNoNamespaceFactory ( )
Exceptions
Crawler

Definition at line 97 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

97  : void
98  {
99  try {
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());
104  }
105  }

◆ testParseValidFile()

FactoriesCrawlerTest::testParseValidFile ( )
Exceptions
Crawler

Definition at line 54 of file FactoriesCrawlerTest.php.

54  : void
55  {
56  $entries = $this->crawler->crawlFactory(__DIR__ . "/../../../../../components/ILIAS/UI/tests/Crawler/Fixture/ComponentsTreeFixture/RootFactory.php");
57  $this->assertCount(6, $entries);
58  $this->assertCount(
59  2,
60  $entries->getEntryById("testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")->getChildren()
61  );
62  $this->assertCount(
63  3,
64  $entries->getDescendantsOfEntry("testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")
65  );
66  $this->assertCount(
67  1,
68  $entries->getEntryById("testsUICrawlerFixtureComponentsTreeFixtureComponent2FactoryComponent2")->getChildren()
69  );
70  $this->assertCount(
71  0,
72  $entries->getParentsOfEntry("testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")
73  );
74  $this->assertCount(
75  2,
76  $entries->getParentsOfEntry("testsUICrawlerFixtureComponentsTreeFixtureComponent1component12component121Component121")
77  );
78  }

Field Documentation

◆ $crawler

Crawler FactoriesCrawler FactoriesCrawlerTest::$crawler
protected

Definition at line 29 of file FactoriesCrawlerTest.php.


The documentation for this class was generated from the following file: