ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
FactoriesCrawlerTest Class Reference
+ Inheritance diagram for FactoriesCrawlerTest:
+ Collaboration diagram for FactoriesCrawlerTest:

Public Member Functions

 testAccessInvalidEntry ()
 
 testParseValidFile ()
 
 testLoopFactory ()
 
 testIdenticalNamesFactory ()
 
 testIdenticalEntriesFactory ()
 
 testNoNamespaceFactory ()
 
 testNoClosingDescriptionFactory ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $crawler
 

Detailed Description

Definition at line 9 of file FactoriesCrawlerTest.php.

Member Function Documentation

◆ setUp()

FactoriesCrawlerTest::setUp ( )
protected

Definition at line 19 of file FactoriesCrawlerTest.php.

◆ testAccessInvalidEntry()

FactoriesCrawlerTest::testAccessInvalidEntry ( )
Exceptions
Crawler

Definition at line 27 of file FactoriesCrawlerTest.php.

28  {
29  try {
30  $entries = $this->crawler->crawlFactory("tests/UI/Crawler/Fixture/ComponentsTreeFixture/RootFactory.php");
31  $entries->getEntryById("NonExistent")->getChildren();
32  $entries->getParentsOfEntry("NonExistent");
33  $this->assertFalse("This should not happen");
34  } catch (Crawler\Exception\CrawlerException $e) {
35  $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::INVALID_ID);
36  }
37  }

◆ testIdenticalEntriesFactory()

FactoriesCrawlerTest::testIdenticalEntriesFactory ( )
Exceptions
Crawler

Definition at line 81 of file FactoriesCrawlerTest.php.

82  {
83  try {
84  $this->crawler->crawlFactory("tests/UI/Crawler/Fixture/IdenticalEntriesFactory.php");
85  $this->assertFalse("This should not happen");
86  } catch (Crawler\Exception\CrawlerException $e) {
87  $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::DUPLICATE_ENTRY);
88  }
89  }

◆ testIdenticalNamesFactory()

FactoriesCrawlerTest::testIdenticalNamesFactory ( )
Exceptions
Crawler

Definition at line 72 of file FactoriesCrawlerTest.php.

73  {
74  $this->crawler->crawlFactory("tests/UI/Crawler/Fixture/IdenticalNamesFactory.php");
75  $this->assertTrue(true);
76  }

◆ testLoopFactory()

FactoriesCrawlerTest::testLoopFactory ( )
Exceptions
Crawler

Definition at line 57 of file FactoriesCrawlerTest.php.

58  {
59  try {
60  $this->crawler->crawlFactory("tests/UI/Crawler/Fixture/LoopFactory.php");
61 
62  $this->assertFalse("This should not happen");
63  } catch (Crawler\Exception\CrawlerException $e) {
64  $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::CRAWL_MAX_NESTING_REACHED);
65  }
66  }

◆ testNoClosingDescriptionFactory()

FactoriesCrawlerTest::testNoClosingDescriptionFactory ( )
Exceptions
Crawler

Definition at line 107 of file FactoriesCrawlerTest.php.

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

◆ testNoNamespaceFactory()

FactoriesCrawlerTest::testNoNamespaceFactory ( )
Exceptions
Crawler

Definition at line 94 of file FactoriesCrawlerTest.php.

95  {
96  try {
97  $this->crawler->crawlFactory("tests/UI/Crawler/Fixture/NoNamespaceFactory.php");
98  $this->assertFalse("This should not happen");
99  } catch (Crawler\Exception\CrawlerException $e) {
100  $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::ENTRY_WITH_NO_VALID_RETURN_STATEMENT);
101  }
102  }

◆ testParseValidFile()

FactoriesCrawlerTest::testParseValidFile ( )
Exceptions
Crawler

Definition at line 42 of file FactoriesCrawlerTest.php.

43  {
44  $entries = $this->crawler->crawlFactory("tests/UI/Crawler/Fixture/ComponentsTreeFixture/RootFactory.php");
45  $this->assertEquals(6, count($entries));
46 
47  $this->assertEquals(2, count($entries->getEntryById("testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")->getChildren()));
48  $this->assertEquals(3, count($entries->getDescendantsOfEntry("testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")));
49  $this->assertEquals(1, count($entries->getEntryById("testsUICrawlerFixtureComponentsTreeFixtureComponent2FactoryComponent2")->getChildren()));
50  $this->assertEquals(0, count($entries->getParentsOfEntry("testsUICrawlerFixtureComponentsTreeFixtureComponent1FactoryComponent1")));
51  $this->assertEquals(2, count($entries->getParentsOfEntry("testsUICrawlerFixtureComponentsTreeFixtureComponent1component12component121Component121")));
52  }

Field Documentation

◆ $crawler

FactoriesCrawlerTest::$crawler
protected

Definition at line 16 of file FactoriesCrawlerTest.php.


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