@@ -6,21 +6,31 @@ class RPSNewCoreControlClassTest extends PHPUnit_Framework_TestCase {
6
6
7
7
public function setUp () {
8
8
require_once ("bootstrap.php " );
9
- $ this ->availableControls = array ("Game " , " Page " );
9
+ $ this ->availableControls = array ("Game " );
10
10
}
11
11
12
12
public function testexecuteControlReturnsAnArray () {
13
+
14
+ $ mockPageVars = array ();
15
+ $ mockPageVars ["route " ] = array ();
16
+ $ mockPageVars ["route " ]["action " ] = "home " ;
17
+
13
18
$ control = new Core \Control () ;
14
19
foreach ($ this ->availableControls as $ availableControl ) {
15
- $ currentControlOutput = $ control ->executeControl ($ availableControl , array () );
20
+ $ currentControlOutput = $ control ->executeControl ($ availableControl , $ mockPageVars );
16
21
$ this ->assertTrue ( is_array ($ currentControlOutput ) );
17
22
}
18
23
}
19
24
20
25
public function testexecuteControlReturnsAnArrayOfCorrectStructure () {
26
+
27
+ $ mockPageVars = array ();
28
+ $ mockPageVars ["route " ] = array ();
29
+ $ mockPageVars ["route " ]["action " ] = "home " ;
30
+
21
31
$ control = new Core \Control () ;
22
32
foreach ($ this ->availableControls as $ availableControl ) {
23
- $ currentControlOutput = $ control ->executeControl ($ availableControl , array () );
33
+ $ currentControlOutput = $ control ->executeControl ($ availableControl , $ mockPageVars );
24
34
$ this ->assertTrue ( array_key_exists ("view " , $ currentControlOutput ) );
25
35
$ this ->assertTrue ( array_key_exists ("pageVars " , $ currentControlOutput ) );
26
36
}
0 commit comments