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;
37 "responsiveness" => [],
52 "usage" => [
"Correct"],
53 "composition" =>
"Wrong"
57 "usage" => [
"Correct"],
58 "composition" => [[
"wrong"]]
62 "usage" => [1 =>
"Usage Rule 1", 2 =>
"Usage Rule 2"],
63 "composition" => [1 =>
"composition Rule 1", 2 =>
"composition Rule 2"],
64 "interaction" => [1 =>
"interaction Rule 1", 2 =>
"interaction Rule 2"],
65 "wording" => [1 =>
"wording Rule 1", 2 =>
"wording Rule 2"],
66 "ordering" => [1 =>
"ordering Rule 1", 2 =>
"ordering Rule 2"],
67 "style" => [1 =>
"style Rule 1", 2 =>
"style Rule 2"],
68 "responsiveness" => [1 =>
"responsiveness Rule 1", 2 =>
"responsiveness Rule 2"],
69 "accessibility" => [1 =>
"accessibility Rule 1", 2 =>
"accessibility Rule 2"]
73 "usage" => [1 =>
"Usage Rule 1", 2 =>
"Usage Rule 2"],
78 "usage" => [1 =>
"Usage Rule 1", 2 =>
"Usage Rule 2"],
84 "responsiveness" => [],
91 protected function setUp(): void
104 $this->assertEquals($this->empty_rules_array, $rule->getRules());
107 $this->assertEquals($this->empty_rules_array, $rule->getRules());
116 $this->assertFalse($rules->hasRules());
118 $this->assertTrue($rules->hasRules());
126 $this->expectException(TypeError::class);
129 $this->expectException(TypeError::class);
140 $this->assertFalse(
"This should not happen");
142 $this->assertEquals(
Crawler\Exception\CrawlerException::INVALID_INDEX,
$e->getCode());
153 $this->assertFalse(
"This should not happen");
155 $this->assertEquals(
Crawler\Exception\CrawlerException::INVALID_INDEX,
$e->getCode());
166 $this->assertFalse(
"This should not happen");
168 $this->assertEquals(
Crawler\Exception\CrawlerException::ARRAY_EXPECTED,
$e->getCode());
179 $this->assertFalse(
"This should not happen");
181 $this->assertEquals(
Crawler\Exception\CrawlerException::STRING_EXPECTED,
$e->getCode());
191 $this->assertEquals($this->correct_rules1_array, $rules->getRules());
200 $this->assertEquals($this->correct_rules2_array_return, $rules->getRules());
205 $entry = $this->parser->parseArrayFromFile(
"components/ILIAS/UI/tests/Crawler/Fixture/ProperEntry.php")[0];
207 $entry[
"rules"][
'composition'] = [];
208 $entry[
"rules"][
'interaction'] = [];
209 $entry[
"rules"][
'wording'] = [];
210 $entry[
"rules"][
'ordering'] = [];
211 $entry[
"rules"][
'responsiveness'] = [];
212 $entry[
"rules"][
'accessibility'] = [];
215 $this->assertEquals($rules->getRules(), $entry[
"rules"]);
array $correct_rules1_array
array $invalid_category_item_array
Crawler EntriesYamlParser $parser
testParseProperEntryToArray()
ProperEntryFixture $proper_entry
array $invalid_category_value_array
array $invalid_categories2_array
array $correct_rules2_array
testInvalidCategoryValue()
array $invalid_categories1_array
testInvalidCategoryItem()
array $correct_rules2_array_return
Container to hold rules of UI Components.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...