19 declare(strict_types=1);
    21 require_once(
"vendor/composer/vendor/autoload.php");
    22 include_once(
"components/ILIAS/UI/tests/Crawler/Fixture/Fixture.php");
    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",
    75     protected Crawler\EntriesYamlParser 
$parser;
    78     protected function setUp(): void
    80         $this->parser = 
new Crawler\EntriesYamlParser();
    89         $description = 
new Entry\ComponentEntryDescription();
    90         $this->assertEquals($this->empty_description_array, $description->getDescription());
    92         $description = 
new Entry\ComponentEntryDescription(array());
    93         $this->assertEquals($this->empty_description_array, $description->getDescription());
   100         $this->expectException(TypeError::class);
   101         new Entry\ComponentEntryDescription(null);
   103         $this->expectException(TypeError::class);
   104         new Entry\ComponentEntryDescription(
'desc1');
   112             new Entry\ComponentEntryDescription($this->invalid_categories1_array);
   113             $this->assertFalse(
"This should not happen");
   115             $this->assertEquals(
Crawler\
Exception\CrawlerException::INVALID_INDEX, $e->getCode());
   124             new Entry\ComponentEntryDescription($this->invalid_categories2_array);
   125             $this->assertFalse(
"This should not happen");
   127             $this->assertEquals(
Crawler\
Exception\CrawlerException::INVALID_INDEX, $e->getCode());
   136             new Entry\ComponentEntryDescription($this->invalid_category_item_array);
   137             $this->assertFalse(
"This should not happen");
   139             $this->assertEquals(
Crawler\
Exception\CrawlerException::STRING_EXPECTED, $e->getCode());
   148             new Entry\ComponentEntryDescription($this->invalid_category_value_array);
   149             $this->assertFalse(
"This should not happen");
   151             $this->assertEquals(
Crawler\
Exception\CrawlerException::STRING_EXPECTED, $e->getCode());
   159         $description = 
new Entry\ComponentEntryDescription($this->correct_description1_array);
   160         $this->assertEquals($this->correct_description1_array, $description->getDescription());
   168         $description = 
new Entry\ComponentEntryDescription($this->correct_description2_array);
   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'] = 
"";
   179         $description = 
new Entry\ComponentEntryDescription($entry[
"description"]);
   181         $this->assertEquals($description->getDescription(), $entry[
"description"]);
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
array $invalid_categories1_array
 
testParseProperEntryToArray()
 
testCorrectDescription1()
 
array $empty_description_array
 
array $correct_description2_array
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
array $invalid_categories2_array
 
Crawler EntriesYamlParser $parser
 
testInvalidCategoryValue()
 
array $correct_description1_array
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
testCorrectDescription2()
 
array $correct_description2_array_return
 
ProperEntryFixture $proper_entry
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
testInvalidCategoryItem()
 
array $invalid_category_item_array
 
array $invalid_category_value_array