Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Updated tests for Module::init()
Browse files Browse the repository at this point in the history
- Populate and pass a ModuleManager to the method instead of an event instance.
  The module manager will return the event via its getEvent() method.
  • Loading branch information
weierophinney committed Apr 18, 2016
1 parent d9c4bcb commit 98e8e51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/ModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public function testInitRegistersPluginManagerSpecificationWithServiceListener()
$event = $this->prophesize(TestAsset\ModuleEventInterface::class);
$event->getParam('ServiceManager')->willReturn($container->reveal());

$this->assertNull($this->module->init($event->reveal()));
$moduleManager = $this->prophesize(TestAsset\ModuleManagerInterface::class);
$moduleManager->getEvent()->willReturn($event->reveal());

$this->assertNull($this->module->init($moduleManager->reveal()));
}
}
13 changes: 13 additions & 0 deletions test/TestAsset/ModuleManagerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* @link http://github.com/zendframework/zend-i18n for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendTest\I18n\TestAsset;

interface ModuleManagerInterface
{
public function getEvent();
}

0 comments on commit 98e8e51

Please sign in to comment.