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

Commit 3e3c202

Browse files
committed
Merge pull request #353 from gianarb/feature/fetch-repos
List of repositories from Github
2 parents 00931f7 + fa9e0e4 commit 3e3c202

File tree

2 files changed

+9
-43
lines changed

2 files changed

+9
-43
lines changed

module/ZfModule/src/ZfModule/Controller/IndexController.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ private function unregisteredRepositories(RepositoryCollection $repositories)
136136
return false;
137137
}
138138

139-
if (!$this->moduleService->isModule($repository)) {
140-
return false;
141-
}
142-
143139
if ($this->moduleMapper->findByName($repository->name)) {
144140
return false;
145141
}

module/ZfModule/test/ZfModuleTest/Integration/Controller/IndexControllerTest.php

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,18 @@ public function testIndexActionFetches100MostRecentlyUpdatedUserRepositories()
8484
$this->assertResponseStatusCode(Http\Response::STATUS_CODE_200);
8585
}
8686

87-
public function testIndexActionRendersValidModulesOnly()
87+
public function testIndexActionRendersUnregisteredModulesOnly()
8888
{
8989
$this->authenticatedAs(new User());
9090

91-
$validModule = $this->validModule();
92-
93-
$nonModule = $this->nonModule();
91+
$unregisteredModule = $this->validModule();
9492
$registeredModule = $this->registeredModule();
9593

9694
$repositories = [
97-
$validModule,
98-
$nonModule,
95+
$unregisteredModule,
9996
$registeredModule,
100-
$this->forkedModule(),
10197
$this->moduleWithoutPushPermissions(),
98+
$this->forkedModule(),
10299
];
103100

104101
$repositoryCollection = $this->repositoryCollectionMock($repositories);
@@ -119,18 +116,6 @@ public function testIndexActionRendersValidModulesOnly()
119116
->getMock()
120117
;
121118

122-
$moduleService
123-
->expects($this->any())
124-
->method('isModule')
125-
->willReturnCallback(function ($repository) use ($nonModule) {
126-
if ($repository !== $nonModule) {
127-
return true;
128-
}
129-
130-
return false;
131-
})
132-
;
133-
134119
$moduleMapper = $this->getMockBuilder(Mapper\Module::class)
135120
->disableOriginalConstructor()
136121
->getMock()
@@ -180,7 +165,7 @@ public function testIndexActionRendersValidModulesOnly()
180165

181166
$this->assertInternalType('array', $viewVariable);
182167
$this->assertCount(1, $viewVariable);
183-
$this->assertSame($validModule, $viewVariable[0]);
168+
$this->assertSame($unregisteredModule, $viewVariable[0]);
184169
}
185170

186171
public function testOrganizationActionRedirectsIfNotAuthenticated()
@@ -290,18 +275,15 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW
290275
$this->assertResponseStatusCode(Http\Response::STATUS_CODE_200);
291276
}
292277

293-
public function testOrganizationActionRendersValidModulesOnly()
278+
public function testOrganizationActionRendersUnregisteredModulesOnly()
294279
{
295280
$this->authenticatedAs(new User());
296281

297-
$validModule = $this->validModule();
298-
299-
$nonModule = $this->nonModule();
282+
$unregisteredModule = $this->validModule();
300283
$registeredModule = $this->registeredModule();
301284

302285
$repositories = [
303-
$validModule,
304-
$nonModule,
286+
$unregisteredModule,
305287
$registeredModule,
306288
$this->forkedModule(),
307289
$this->moduleWithoutPushPermissions(),
@@ -327,18 +309,6 @@ public function testOrganizationActionRendersValidModulesOnly()
327309
->getMock()
328310
;
329311

330-
$moduleService
331-
->expects($this->any())
332-
->method('isModule')
333-
->willReturnCallback(function ($repository) use ($nonModule) {
334-
if ($repository !== $nonModule) {
335-
return true;
336-
}
337-
338-
return false;
339-
})
340-
;
341-
342312
$moduleMapper = $this->getMockBuilder(Mapper\Module::class)
343313
->disableOriginalConstructor()
344314
->getMock()
@@ -393,7 +363,7 @@ public function testOrganizationActionRendersValidModulesOnly()
393363

394364
$this->assertInternalType('array', $viewVariable);
395365
$this->assertCount(1, $viewVariable);
396-
$this->assertSame($validModule, $viewVariable[0]);
366+
$this->assertSame($unregisteredModule, $viewVariable[0]);
397367
}
398368

399369
public function testAddActionRedirectsIfNotAuthenticated()

0 commit comments

Comments
 (0)