diff --git a/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php b/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php index 164c4f4b..21101847 100644 --- a/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php +++ b/module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php @@ -228,6 +228,65 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW $this->assertResponseStatusCode(Http\Response::STATUS_CODE_200); } + /** + * @dataProvider providerInvalidVendor + * @param $vendor + */ + public function testOrganizationActionDoesNotMatchOnInvalidVendor($vendor) + { + $this->authenticatedAs(new User()); + + $repositoryCollection = $this->repositoryCollectionMock(); + + $repositoryRetriever = $this->getMockBuilder(RepositoryRetriever::class) + ->disableOriginalConstructor() + ->getMock() + ; + + $repositoryRetriever + ->expects($this->any()) + ->method('getUserRepositories') + ->with( + $this->equalTo($vendor), + $this->equalTo([ + 'per_page' => 100, + 'sort' => 'updated', + 'direction' => 'desc', + ] + )) + ->willReturn($repositoryCollection) + ; + + $this->getApplicationServiceLocator() + ->setAllowOverride(true) + ->setService( + RepositoryRetriever::class, + $repositoryRetriever + ) + ; + + $url = sprintf( + '/module/list/%s', + $vendor + ); + + $this->dispatch($url); + + $this->assertResponseStatusCode(Http\Response::STATUS_CODE_404); + } + + /** + * @return array + */ + public function providerInvalidVendor() + { + return [ + [ + '9', + ], + ]; + } + public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesWithOwnerSpecified() { $this->authenticatedAs(new User());