ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 19 of file FactoriesCrawlerTest.php.

◆ testAccessInvalidEntry()

FactoriesCrawlerTest::testAccessInvalidEntry ( )
Exceptions
Crawler

Definition at line 26 of file FactoriesCrawlerTest.php.

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

◆ testIdenticalEntriesFactory()

FactoriesCrawlerTest::testIdenticalEntriesFactory ( )
Exceptions
Crawler

Definition at line 79 of file FactoriesCrawlerTest.php.

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

◆ testIdenticalNamesFactory()

FactoriesCrawlerTest::testIdenticalNamesFactory ( )
Exceptions
Crawler

Definition at line 71 of file FactoriesCrawlerTest.php.

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

◆ testLoopFactory()

FactoriesCrawlerTest::testLoopFactory ( )
Exceptions
Crawler

Definition at line 56 of file FactoriesCrawlerTest.php.

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

◆ testNoClosingDescriptionFactory()

FactoriesCrawlerTest::testNoClosingDescriptionFactory ( )
Exceptions
Crawler

Definition at line 106 of file FactoriesCrawlerTest.php.

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

◆ testNoNamespaceFactory()

FactoriesCrawlerTest::testNoNamespaceFactory ( )
Exceptions
Crawler

Definition at line 92 of file FactoriesCrawlerTest.php.

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

◆ testParseValidFile()

FactoriesCrawlerTest::testParseValidFile ( )
Exceptions
Crawler

Definition at line 41 of file FactoriesCrawlerTest.php.

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

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: