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

Commit 4eecbc3

Browse files
localheinzGianluca Arbezzano
authored andcommitted
Fix: Yet another test
1 parent 7c80ed1 commit 4eecbc3

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

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

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,15 @@ public function testOrganizationActionFetches100MostRecentlyUpdatedRepositoriesW
280280
$this->assertResponseStatusCode(Http\Response::STATUS_CODE_200);
281281
}
282282

283-
public function testOrganizationActionRendersValidModulesOnly()
283+
public function testOrganizationActionRendersUnregisteredModulesOnly()
284284
{
285285
$this->authenticatedAs(new User());
286286

287-
$validModule = $this->validModule();
288-
289-
$nonModule = $this->nonModule();
287+
$unregisteredModule = $this->validModule();
290288
$registeredModule = $this->registeredModule();
291289

292290
$repositories = [
293-
$validModule,
294-
$nonModule,
291+
$unregisteredModule,
295292
$registeredModule,
296293
$this->forkedModule(),
297294
$this->moduleWithoutPushPermissions(),
@@ -318,15 +315,8 @@ public function testOrganizationActionRendersValidModulesOnly()
318315
;
319316

320317
$moduleService
321-
->expects($this->any())
318+
->expects($this->never())
322319
->method('isModule')
323-
->willReturnCallback(function ($repository) use ($nonModule) {
324-
if ($repository !== $nonModule) {
325-
return true;
326-
}
327-
328-
return false;
329-
})
330320
;
331321

332322
$moduleMapper = $this->getMockBuilder(Mapper\Module::class)
@@ -382,8 +372,8 @@ public function testOrganizationActionRendersValidModulesOnly()
382372
$viewVariable = $viewModel->getVariable('repositories');
383373

384374
$this->assertInternalType('array', $viewVariable);
385-
$this->assertCount(2, $viewVariable);
386-
$this->assertSame($validModule, $viewVariable[0]);
375+
$this->assertCount(1, $viewVariable);
376+
$this->assertSame($unregisteredModule, $viewVariable[0]);
387377
}
388378

389379
public function testAddActionRedirectsIfNotAuthenticated()

0 commit comments

Comments
 (0)