Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
Enhancement: Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Mar 5, 2015
1 parent bb778f3 commit 7b32f37
Showing 1 changed file with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 7b32f37

Please sign in to comment.