@@ -23,6 +23,7 @@ class ProfileControllerTest extends \PHPUnit_Framework_TestCase
2323 public function setUp ()
2424 {
2525 $ this ->mockUserEntity = new \ZfcUser \Entity \User ();
26+ $ this ->mockUserEntity ->setId (42 );
2627
2728 $ this ->mockUserService = \Mockery::mock ('ZfcUser\Service\User ' );
2829
@@ -105,7 +106,8 @@ public function testControllerDispatchedWithValidFormDataWillCompleteAndRedirect
105106
106107 $ req = $ this ->controller ->getRequest ();
107108 $ req ->setMethod (Request::METHOD_POST );
108- $ req ->getPost ()->set ('foo ' , 'bar ' );
109+ $ req ->getPost ()->set ('foo ' , ['bar ' => 'baz ' ]);
110+ $ req ->getPost ()->set ('zfcuser ' , ['id ' => 42 ]);
109111
110112 $ postData = $ req ->getPost ()->toArray ();
111113 $ mockResult = new \stdClass ();
@@ -133,7 +135,8 @@ public function testControllerDispatchedWithInvalidFormDataWillRenderForm()
133135
134136 $ req = $ this ->controller ->getRequest ();
135137 $ req ->setMethod (Request::METHOD_POST );
136- $ req ->getPost ()->set ('foo ' , 'bar ' );
138+ $ req ->getPost ()->set ('foo ' , ['bar ' => 'baz ' ]);
139+ $ req ->getPost ()->set ('zfcuser ' , ['id ' => 42 ]);
137140
138141 $ postData = $ req ->getPost ()->toArray ();
139142 $ mockResult = new \stdClass ();
@@ -159,7 +162,8 @@ public function testControllerWillRenderFormWhenSaveCallFails()
159162
160163 $ req = $ this ->controller ->getRequest ();
161164 $ req ->setMethod (Request::METHOD_POST );
162- $ req ->getPost ()->set ('foo ' , 'bar ' );
165+ $ req ->getPost ()->set ('foo ' , ['bar ' => 'baz ' ]);
166+ $ req ->getPost ()->set ('zfcuser ' , ['id ' => 42 ]);
163167
164168 $ postData = $ req ->getPost ()->toArray ();
165169 $ mockResult = new \stdClass ();
0 commit comments