File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,23 @@ public function testExecuteReturnsAnArrayWithGameIntroWhenActionIsNotHomeOrChoos
6161 $ this ->assertTrue ( $ returnRay ["view " ]=="gameIntro " );
6262 }
6363
64+ public function testExecuteReturnsAnArrayWithGameCompleteWhenActionIsChoosePlayersAndRunIsSet () {
65+ $ mockPageVars = array ();
66+ $ mockPageVars ["route " ] = array ();
67+ $ mockPageVars ["route " ]["action " ] = "choosePlayers " ;
68+ $ control = new \Controller \Game ();
69+ $ _REQUEST ["run " ] = "run " ;
70+ $ _REQUEST ["p1type " ] = "human " ;
71+ $ _REQUEST ["p1choice " ] = "rock " ;
72+ $ _REQUEST ["p2type " ] = "human " ;
73+ $ _REQUEST ["p2choice " ] = "scissors " ;
74+ $ returnRay = $ control ->execute ($ mockPageVars );
75+ $ this ->assertTrue ( array_key_exists ("type " , $ returnRay ) );
76+ $ this ->assertTrue ( $ returnRay ["type " ]=="view " );
77+ $ this ->assertTrue ( array_key_exists ("view " , $ returnRay ) );
78+ $ this ->assertTrue ( $ returnRay ["view " ]=="gameComplete " );
79+ }
80+
6481 public function testGetRandomPlayerChoiceReturnsValue () {
6582 $ control = new \Controller \Game ();
6683 $ reflector = new ReflectionMethod ($ control , "getRandomPlayerChoice " );
You can’t perform that action at this time.
0 commit comments