4 require_once(
"libs/composer/vendor/autoload.php");
5 include_once(
"tests/UI/Crawler/Fixture/Fixture.php");
33 "purpose" =>
"Correct",
34 "composition" => array(
"Wrong")
37 "purpose" =>
"Correct",
38 "rivals" => array(array(
"wrong"))
42 "purpose" =>
"Purpose Description",
43 "composition" =>
"Composition Description",
44 "effect" =>
"Effect Description",
45 "rivals" => array(
"Element 1" =>
"Rival 1",
"Element 2" =>
"Rival 2")
49 "purpose" =>
"Purpose Description" 53 "purpose" =>
"Purpose Description",
69 protected function setUp() : void
81 $description =
new Entry\ComponentEntryDescription();
82 $this->assertEquals($this->empty_description_array, $description->getDescription());
84 $description =
new Entry\ComponentEntryDescription(array());
85 $this->assertEquals($this->empty_description_array, $description->getDescription());
93 new Entry\ComponentEntryDescription(null);
94 new Entry\ComponentEntryDescription(
"desc1");
95 $this->assertFalse(
"This should not happen");
97 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::ARRAY_EXPECTED);
106 new Entry\ComponentEntryDescription($this->invalid_categories1_array);
107 $this->assertFalse(
"This should not happen");
109 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::INVALID_INDEX);
118 new Entry\ComponentEntryDescription($this->invalid_categories2_array);
119 $this->assertFalse(
"This should not happen");
121 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::INVALID_INDEX);
130 new Entry\ComponentEntryDescription($this->invalid_category_item_array);
131 $this->assertFalse(
"This should not happen");
133 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::STRING_EXPECTED);
142 new Entry\ComponentEntryDescription($this->invalid_category_value_array);
143 $this->assertFalse(
"This should not happen");
145 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::STRING_EXPECTED);
153 $description =
new Entry\ComponentEntryDescription($this->correct_description1_array);
154 $this->assertEquals($this->correct_description1_array, $description->getDescription());
162 $description =
new Entry\ComponentEntryDescription($this->correct_description2_array);
163 $this->assertEquals($this->correct_description2_array_return, $description->getDescription());
168 $entry = $this->parser->parseArrayFromFile(
"tests/UI/Crawler/Fixture/ProperEntry.php")[0];
170 $entry[
"description"][
'composition'] =
"";
171 $entry[
"description"][
'effect'] =
"";
173 $description =
new Entry\ComponentEntryDescription($entry[
"description"]);
175 $this->assertEquals($description->getDescription(), $entry[
"description"]);
testParseProperEntryToArray()
testCorrectDescription1()
$invalid_categories2_array
$correct_description2_array_return
$correct_description2_array
$invalid_category_item_array
$correct_description1_array
$invalid_categories1_array
testInvalidCategoryValue()
testCorrectDescription2()
testInvalidCategoryItem()
$invalid_category_value_array