4 require_once(
"libs/composer/vendor/autoload.php");
5 include_once(
"tests/UI/Crawler/Fixture/Fixture.php");
35 $this->parser->parseYamlStringArrayFromFile(
"Invalid Path");
36 $this->assertFalse(
"This should not happen");
38 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::INVALID_FILE_PATH);
47 $yaml_entries = $this->parser->parseYamlStringArrayFromFile(
"tests/UI/Crawler/Fixture/ProperEntry.php");
49 $this->assertEquals($this->proper_entry->properEntryYamlString, $yaml_entries[0]);
50 $this->assertEquals($this->proper_entry->properEntryYamlString, $yaml_entries[0]);
55 $entries = $this->parser->parseArrayFromFile(
"tests/UI/Crawler/Fixture/ProperEntry.php");
56 $this->assertEquals($this->proper_entry->properEntryYamlArray, $entries);
65 $this->parser->parseYamlStringArrayFromFile(
"tests/UI/Crawler/Fixture/NoDescriptionEntry.php");
66 $this->assertFalse(
"This should not happen");
68 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::ENTRY_WITH_NO_YAML_DESCRIPTION);
77 $this->parser->parseYamlStringArrayFromFile(
"tests/UI/Crawler/Fixture/NoReturnValueEntry.php");
78 $this->assertFalse(
"This should not happen");
80 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::ENTRY_WITH_NO_VALID_RETURN_STATEMENT);
90 $this->parser->parseArrayFromFile(
"tests/UI/Crawler/Fixture/InvalidYamlEntry.php");
91 $this->assertFalse(
"This should not happen");
93 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::PARSING_YAML_ENTRY_FAILED);
99 $test_string =
"Hello Camel Case";
101 $this->assertEquals(
"helloCamelCase",
Crawler\EntriesYamlParser::toLowerCamelCase($test_string,
' '));
102 $this->assertEquals(
"HelloCamelCase",
Crawler\EntriesYamlParser::toUpperCamelCase($test_string,
' '));
110 $entries = $this->parser->parseEntriesFromFile(
"tests/UI/Crawler/Fixture/ProperEntry.php");
112 $this->assertEquals(1, count($entries));
113 $this->assertEquals(
"CrawlerFixtureProperEntryProperEntry", $entries->getEntryById(
"CrawlerFixtureProperEntryProperEntry")->getId());
114 $this->assertEquals(
"src/UI/Crawler/Fixture/ProperEntry", $entries->getEntryById(
"CrawlerFixtureProperEntryProperEntry")->getPath());
testParseProperEntryToArray()
testParseProperEntryToYamlEntries()