ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
CrawlerTest Class Reference
+ Inheritance diagram for CrawlerTest:
+ Collaboration diagram for CrawlerTest:

Public Member Functions

 testParseInvalidFile ()
 
 testParseProperEntryToYamlEntries ()
 
 testParseProperEntryToArray ()
 
 testNoDescriptionEntry ()
 
 testNoReturnValueEntry ()
 
 testInvalidYamlEntry ()
 
 testCamelCase ()
 
 testGenerateEntry ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

Crawler EntriesYamlParser $parser
 
ProperEntryFixture $proper_entry
 

Detailed Description

Definition at line 27 of file EntriesYamlParserTest.php.

Member Function Documentation

◆ setUp()

CrawlerTest::setUp ( )
protected

Definition at line 32 of file EntriesYamlParserTest.php.

32  : void
33  {
34  $this->parser = new Crawler\EntriesYamlParser();
35  $this->proper_entry = new ProperEntryFixture();
36  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Fixture.php:18

◆ testCamelCase()

CrawlerTest::testCamelCase ( )

Definition at line 106 of file EntriesYamlParserTest.php.

106  : void
107  {
108  $test_string = "Hello Camel Case";
109 
110  $this->assertEquals("helloCamelCase", Crawler\EntriesYamlParser::toLowerCamelCase($test_string, ' '));
111  $this->assertEquals("HelloCamelCase", Crawler\EntriesYamlParser::toUpperCamelCase($test_string, ' '));
112  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Crawler.php:21

◆ testGenerateEntry()

CrawlerTest::testGenerateEntry ( )
Exceptions
Crawler

Definition at line 117 of file EntriesYamlParserTest.php.

117  : void
118  {
119  $entries = $this->parser->parseEntriesFromFile("tests/UI/Crawler/Fixture/ProperEntry.php");
120 
121  $this->assertCount(1, $entries);
122  $this->assertEquals(
123  "CrawlerFixtureProperEntryProperEntry",
124  $entries->getEntryById("CrawlerFixtureProperEntryProperEntry")->getId()
125  );
126  $this->assertEquals(
127  "src/UI/Crawler/Fixture/ProperEntry",
128  $entries->getEntryById("CrawlerFixtureProperEntryProperEntry")->getPath()
129  );
130  }

◆ testInvalidYamlEntry()

CrawlerTest::testInvalidYamlEntry ( )
Exceptions
Crawler

Definition at line 96 of file EntriesYamlParserTest.php.

References Vendor\Package\$e.

96  : void
97  {
98  try {
99  $this->parser->parseArrayFromFile("tests/UI/Crawler/Fixture/InvalidYamlEntry.php");
100  $this->assertFalse("This should not happen");
102  $this->assertEquals(Crawler\Exception\CrawlerException::PARSING_YAML_ENTRY_FAILED, $e->getCode());
103  }
104  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Crawler.php:21

◆ testNoDescriptionEntry()

CrawlerTest::testNoDescriptionEntry ( )
Exceptions
Crawler

Definition at line 71 of file EntriesYamlParserTest.php.

References Vendor\Package\$e.

71  : void
72  {
73  try {
74  $this->parser->parseYamlStringArrayFromFile("tests/UI/Crawler/Fixture/NoDescriptionEntry.php");
75  $this->assertFalse("This should not happen");
77  $this->assertEquals(Crawler\Exception\CrawlerException::ENTRY_WITH_NO_YAML_DESCRIPTION, $e->getCode());
78  }
79  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Crawler.php:21

◆ testNoReturnValueEntry()

CrawlerTest::testNoReturnValueEntry ( )
Exceptions
Crawler

Definition at line 83 of file EntriesYamlParserTest.php.

References Vendor\Package\$e.

83  : void
84  {
85  try {
86  $this->parser->parseYamlStringArrayFromFile("tests/UI/Crawler/Fixture/NoReturnValueEntry.php");
87  $this->assertFalse("This should not happen");
89  $this->assertEquals(Crawler\Exception\CrawlerException::ENTRY_WITH_NO_VALID_RETURN_STATEMENT, $e->getCode());
90  }
91  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Crawler.php:21

◆ testParseInvalidFile()

CrawlerTest::testParseInvalidFile ( )
Exceptions
Crawler

Definition at line 41 of file EntriesYamlParserTest.php.

References Vendor\Package\$e.

41  : void
42  {
43  try {
44  $this->parser->parseYamlStringArrayFromFile("Invalid Path");
45  $this->assertFalse("This should not happen");
47  $this->assertEquals(Crawler\Exception\CrawlerException::INVALID_FILE_PATH, $e->getCode());
48  }
49  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Crawler.php:21

◆ testParseProperEntryToArray()

CrawlerTest::testParseProperEntryToArray ( )

Definition at line 62 of file EntriesYamlParserTest.php.

62  : void
63  {
64  $entries = $this->parser->parseArrayFromFile("tests/UI/Crawler/Fixture/ProperEntry.php");
65  $this->assertEquals($this->proper_entry->properEntryYamlArray, $entries);
66  }

◆ testParseProperEntryToYamlEntries()

CrawlerTest::testParseProperEntryToYamlEntries ( )
Exceptions
Crawler

Definition at line 54 of file EntriesYamlParserTest.php.

54  : void
55  {
56  $yaml_entries = $this->parser->parseYamlStringArrayFromFile("tests/UI/Crawler/Fixture/ProperEntry.php");
57 
58  $this->assertEquals($this->proper_entry->properEntryYamlString, $yaml_entries[0]);
59  $this->assertEquals($this->proper_entry->properEntryYamlString, $yaml_entries[0]);
60  }

Field Documentation

◆ $parser

Crawler EntriesYamlParser CrawlerTest::$parser
protected

Definition at line 29 of file EntriesYamlParserTest.php.

◆ $proper_entry

ProperEntryFixture CrawlerTest::$proper_entry
protected

Definition at line 30 of file EntriesYamlParserTest.php.


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