ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 10 of file FactoriesCrawlerTest.php.

Member Function Documentation

◆ setUp()

FactoriesCrawlerTest::setUp ( )
protected

Definition at line 20 of file FactoriesCrawlerTest.php.

20  : void
21  {
22  $this->crawler = new Crawler\FactoriesCrawler();
23  }

◆ testAccessInvalidEntry()

FactoriesCrawlerTest::testAccessInvalidEntry ( )
Exceptions
Crawler

Definition at line 28 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

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

◆ testIdenticalEntriesFactory()

FactoriesCrawlerTest::testIdenticalEntriesFactory ( )
Exceptions
Crawler

Definition at line 82 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

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

◆ testIdenticalNamesFactory()

FactoriesCrawlerTest::testIdenticalNamesFactory ( )
Exceptions
Crawler

Definition at line 73 of file FactoriesCrawlerTest.php.

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

◆ testLoopFactory()

FactoriesCrawlerTest::testLoopFactory ( )
Exceptions
Crawler

Definition at line 58 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

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

◆ testNoClosingDescriptionFactory()

FactoriesCrawlerTest::testNoClosingDescriptionFactory ( )
Exceptions
Crawler

Definition at line 108 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

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

◆ testNoNamespaceFactory()

FactoriesCrawlerTest::testNoNamespaceFactory ( )
Exceptions
Crawler

Definition at line 95 of file FactoriesCrawlerTest.php.

References Vendor\Package\$e.

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

◆ testParseValidFile()

FactoriesCrawlerTest::testParseValidFile ( )
Exceptions
Crawler

Definition at line 43 of file FactoriesCrawlerTest.php.

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

Field Documentation

◆ $crawler

FactoriesCrawlerTest::$crawler
protected

Definition at line 17 of file FactoriesCrawlerTest.php.


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