4require_once(
"libs/composer/vendor/autoload.php");
5include_once(
"tests/UI/Crawler/Fixture/Fixture.php");
9use PHPUnit\Framework\TestCase;
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
82 $this->assertEquals($this->empty_description_array, $description->getDescription());
85 $this->assertEquals($this->empty_description_array, $description->getDescription());
95 $this->assertFalse(
"This should not happen");
97 $this->assertEquals(
$e->getCode(),
Crawler\Exception\CrawlerException::ARRAY_EXPECTED);
107 $this->assertFalse(
"This should not happen");
109 $this->assertEquals(
$e->getCode(),
Crawler\Exception\CrawlerException::INVALID_INDEX);
119 $this->assertFalse(
"This should not happen");
121 $this->assertEquals(
$e->getCode(),
Crawler\Exception\CrawlerException::INVALID_INDEX);
131 $this->assertFalse(
"This should not happen");
133 $this->assertEquals(
$e->getCode(),
Crawler\Exception\CrawlerException::STRING_EXPECTED);
143 $this->assertFalse(
"This should not happen");
145 $this->assertEquals(
$e->getCode(),
Crawler\Exception\CrawlerException::STRING_EXPECTED);
154 $this->assertEquals($this->correct_description1_array, $description->getDescription());
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'] =
"";
175 $this->assertEquals($description->getDescription(), $entry[
"description"]);
An exception for terminatinating execution or to throw for unit testing.
$invalid_category_item_array
$invalid_categories2_array
$correct_description2_array
$correct_description2_array_return
testParseProperEntryToArray()
$correct_description1_array
testInvalidCategoryValue()
$invalid_categories1_array
testInvalidCategoryItem()
testCorrectDescription1()
$invalid_category_value_array
testCorrectDescription2()
Container to hold description of UI Components.