4 require_once(
"libs/composer/vendor/autoload.php");
5 include_once(
"tests/UI/Crawler/Fixture/Fixture.php");
14 "composition" => array(),
15 "interaction" => array(),
17 "ordering" => array(),
19 "responsiveness" => array(),
20 "accessibility" => array()
31 "usage" => array(
"Correct"),
32 "composition" =>
"Wrong" 35 "usage" => array(
"Correct"),
36 "composition" => array(array(
"wrong"))
39 "usage" => array(1 =>
"Usage Rule 1", 2 =>
"Usage Rule 2"),
40 "composition" => array(1 =>
"composition Rule 1", 2 =>
"composition Rule 2"),
41 "interaction" => array(1 =>
"interaction Rule 1", 2 =>
"interaction Rule 2"),
42 "wording" => array(1 =>
"wording Rule 1", 2 =>
"wording Rule 2"),
43 "ordering" => array(1 =>
"ordering Rule 1", 2 =>
"ordering Rule 2"),
44 "style" => array(1 =>
"style Rule 1", 2 =>
"style Rule 2"),
45 "responsiveness" => array(1 =>
"responsiveness Rule 1", 2 =>
"responsiveness Rule 2"),
46 "accessibility" => array(1 =>
"accessibility Rule 1", 2 =>
"accessibility Rule 2")
49 "usage" => array(1 =>
"Usage Rule 1", 2 =>
"Usage Rule 2"),
53 "usage" => array(1 =>
"Usage Rule 1", 2 =>
"Usage Rule 2"),
54 "composition" => array(),
55 "interaction" => array(),
57 "ordering" => array(),
59 "responsiveness" => array(),
60 "accessibility" => array()
86 $this->assertEquals($this->empty_rules_array,
$rule->getRules());
89 $this->assertEquals($this->empty_rules_array, $rule->getRules());
98 $this->assertFalse($rules->hasRules());
100 $this->assertTrue($rules->hasRules());
111 $this->assertFalse(
"This should not happen");
113 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::ARRAY_EXPECTED);
123 $this->assertFalse(
"This should not happen");
125 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::INVALID_INDEX);
135 $this->assertFalse(
"This should not happen");
137 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::INVALID_INDEX);
147 $this->assertFalse(
"This should not happen");
149 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::ARRAY_EXPECTED);
159 $this->assertFalse(
"This should not happen");
161 $this->assertEquals($e->getCode(), Crawler\Exception\CrawlerException::STRING_EXPECTED);
170 $this->assertEquals($this->correct_rules1_array, $rules->getRules());
179 $this->assertEquals($this->correct_rules2_array_return, $rules->getRules());
184 $entry = $this->parser->parseArrayFromFile(
"tests/UI/Crawler/Fixture/ProperEntry.php")[0];
186 $entry[
"rules"][
'composition'] = array();
187 $entry[
"rules"][
'interaction'] = array();
188 $entry[
"rules"][
'wording'] = array();
189 $entry[
"rules"][
'ordering'] = array();
190 $entry[
"rules"][
'responsiveness'] = array();
191 $entry[
"rules"][
'accessibility'] = array();
194 $this->assertEquals($rules->getRules(), $entry[
"rules"]);
Container to hold rules of UI Components.
$invalid_categories2_array
testInvalidCategoryValue()
$invalid_category_value_array
testInvalidCategoryItem()
testParseProperEntryToArray()
$invalid_categories1_array
$invalid_category_item_array
$correct_rules2_array_return