@@ -153,12 +153,6 @@ private function setupHandleTest($uid)
153153 ->with ($ cultureFeedConsumer )
154154 ->willReturn ($ culturefeedTestconsumer );
155155
156- // It should add user as admin.
157- $ this ->cultureFeedTest
158- ->expects ($ this ->once ())
159- ->method ('addServiceConsumerAdmin ' )
160- ->with ($ culturefeedTestconsumer ->consumerKey , $ uid );
161-
162156 // It should create a live consumer.
163157 $ this ->cultureFeed
164158 ->expects ($ this ->once ())
@@ -211,69 +205,6 @@ public function testHandle()
211205
212206 $ this ->setupHandleTest ('testuserid ' );
213207
214- // It should search for a user on test.
215- $ searchQuery = new \CultureFeed_SearchUsersQuery ();
216- $ searchQuery ->mbox = 'test@test.be ' ;
217- $ searchQuery ->mboxIncludePrivate = true ;
218- $ result = new \CultureFeed_ResultSet ();
219- $ result ->total = 0 ;
220- $ this ->cultureFeedTest
221- ->expects ($ this ->once ())
222- ->method ('searchUsers ' )
223- ->with ($ searchQuery )
224- ->willReturn ($ result );
225-
226- // It should add a new test user.
227- $ this ->commandHandler
228- ->expects ($ this ->once ())
229- ->method ('generatePassword ' )
230- ->willReturn ('password ' );
231-
232- $ newUser = new \CultureFeed_User ();
233- $ newUser ->mbox = 'test@test.be ' ;
234- $ newUser ->nick = 'test ' ;
235- $ newUser ->password = 'password ' ;
236- $ newUser ->status = \CultureFeed_User::STATUS_PRIVATE ;
237- $ this ->cultureFeedTest
238- ->expects ($ this ->once ())
239- ->method ('createUser ' )
240- ->with ($ newUser )
241- ->willReturn ('testuserid ' );
242-
243- $ createProject = new CreateProject ('Project name ' , 'Project description ' , 123 , 'coupon ' );
244- $ this ->commandHandler ->handle ($ createProject );
245- }
246-
247- /**
248- * Test the command handler when test user does not exist yet.
249- */
250- public function testHandleNewTestUser ()
251- {
252-
253- $ this ->setupHandleTest (20 );
254-
255- $ searchQuery = new \CultureFeed_SearchUsersQuery ();
256- $ searchQuery ->mbox = 'test@test.be ' ;
257- $ searchQuery ->mboxIncludePrivate = true ;
258- $ result = new \CultureFeed_ResultSet ();
259- $ user = new \stdClass ();
260- $ user ->id = '20 ' ;
261- $ result ->total = 1 ;
262- $ result ->objects = [
263- $ user ,
264- ];
265-
266- // It should find a user and never create a user.
267- $ this ->cultureFeedTest
268- ->expects ($ this ->once ())
269- ->method ('searchUsers ' )
270- ->with ($ searchQuery )
271- ->willReturn ($ result );
272-
273- $ this ->cultureFeedTest
274- ->expects ($ this ->never ())
275- ->method ('createUser ' );
276-
277208 $ createProject = new CreateProject ('Project name ' , 'Project description ' , 123 , 'coupon ' );
278209 $ this ->commandHandler ->handle ($ createProject );
279210 }
0 commit comments