19declare(strict_types=1);
21require_once(
"vendor/composer/vendor/autoload.php");
22include_once(
"components/ILIAS/UI/tests/Crawler/Fixture/Fixture.php");
26use PHPUnit\Framework\TestCase;
48 "purpose" =>
"Correct",
49 "composition" => [
"Wrong"]
53 "purpose" =>
"Correct",
54 "rivals" => [[
"wrong"]]
58 "purpose" =>
"Purpose Description",
59 "composition" =>
"Composition Description",
60 "effect" =>
"Effect Description",
61 "rivals" => [
"Element 1" =>
"Rival 1",
"Element 2" =>
"Rival 2"]
65 "purpose" =>
"Purpose Description"
69 "purpose" =>
"Purpose Description",
78 protected function setUp(): void
90 $this->assertEquals($this->empty_description_array, $description->getDescription());
93 $this->assertEquals($this->empty_description_array, $description->getDescription());
100 $this->expectException(TypeError::class);
103 $this->expectException(TypeError::class);
113 $this->assertFalse(
"This should not happen");
115 $this->assertEquals(
Crawler\Exception\CrawlerException::INVALID_INDEX,
$e->getCode());
125 $this->assertFalse(
"This should not happen");
127 $this->assertEquals(
Crawler\Exception\CrawlerException::INVALID_INDEX,
$e->getCode());
137 $this->assertFalse(
"This should not happen");
139 $this->assertEquals(
Crawler\Exception\CrawlerException::STRING_EXPECTED,
$e->getCode());
149 $this->assertFalse(
"This should not happen");
151 $this->assertEquals(
Crawler\Exception\CrawlerException::STRING_EXPECTED,
$e->getCode());
160 $this->assertEquals($this->correct_description1_array, $description->getDescription());
169 $this->assertEquals($this->correct_description2_array_return, $description->getDescription());
174 $entry = $this->parser->parseArrayFromFile(
"components/ILIAS/UI/tests/Crawler/Fixture/ProperEntry.php")[0];
176 $entry[
"description"][
'composition'] =
"";
177 $entry[
"description"][
'effect'] =
"";
181 $this->assertEquals($description->getDescription(), $entry[
"description"]);
ProperEntryFixture $proper_entry
array $invalid_category_value_array
array $invalid_categories1_array
array $correct_description2_array_return
array $invalid_category_item_array
testParseProperEntryToArray()
array $correct_description2_array
array $invalid_categories2_array
array $correct_description1_array
testInvalidCategoryValue()
Crawler EntriesYamlParser $parser
array $empty_description_array
testInvalidCategoryItem()
testCorrectDescription1()
testCorrectDescription2()
Container to hold description of UI Components.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...