This repository was archived by the owner on May 1, 2019. It is now read-only.
File tree 1 file changed +59
-0
lines changed
module/ZfModule/test/ZfModuleTest/Integration/Controller
1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,65 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW
228
228
$ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_200 );
229
229
}
230
230
231
+ /**
232
+ * @dataProvider providerInvalidVendor
233
+ * @param $vendor
234
+ */
235
+ public function testOrganizationActionDoesNotMatchOnInvalidVendor ($ vendor )
236
+ {
237
+ $ this ->authenticatedAs (new User ());
238
+
239
+ $ repositoryCollection = $ this ->repositoryCollectionMock ();
240
+
241
+ $ repositoryRetriever = $ this ->getMockBuilder (RepositoryRetriever::class)
242
+ ->disableOriginalConstructor ()
243
+ ->getMock ()
244
+ ;
245
+
246
+ $ repositoryRetriever
247
+ ->expects ($ this ->any ())
248
+ ->method ('getUserRepositories ' )
249
+ ->with (
250
+ $ this ->equalTo ($ vendor ),
251
+ $ this ->equalTo ([
252
+ 'per_page ' => 100 ,
253
+ 'sort ' => 'updated ' ,
254
+ 'direction ' => 'desc ' ,
255
+ ]
256
+ ))
257
+ ->willReturn ($ repositoryCollection )
258
+ ;
259
+
260
+ $ this ->getApplicationServiceLocator ()
261
+ ->setAllowOverride (true )
262
+ ->setService (
263
+ RepositoryRetriever::class,
264
+ $ repositoryRetriever
265
+ )
266
+ ;
267
+
268
+ $ url = sprintf (
269
+ '/module/list/%s ' ,
270
+ $ vendor
271
+ );
272
+
273
+ $ this ->dispatch ($ url );
274
+
275
+ $ this ->assertResponseStatusCode (Http \Response::STATUS_CODE_404 );
276
+ }
277
+
278
+ /**
279
+ * @return array
280
+ */
281
+ public function providerInvalidVendor ()
282
+ {
283
+ return [
284
+ [
285
+ '9 ' ,
286
+ ],
287
+ ];
288
+ }
289
+
231
290
public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesWithOwnerSpecified ()
232
291
{
233
292
$ this ->authenticatedAs (new User ());
You can’t perform that action at this time.
0 commit comments