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

Commit

Permalink
Merge branch 'hotfix/initializer'
Browse files Browse the repository at this point in the history
Close #45
  • Loading branch information
weierophinney committed Apr 18, 2016
2 parents 419b335 + 04eac21 commit d5ce2dc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.7.2 - TBD
## 2.7.2 - 2016-04-18

### Added

Expand All @@ -18,7 +18,9 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#45](https://github.com/zendframework/zend-i18n/pull/45) fixes the
`Module::init()` method to properly receive a `ModuleManager` instance, and
not expect a `ModuleEvent`.

## 2.7.1 - 2016-03-30

Expand Down
5 changes: 3 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public function getConfig()
/**
* Register a specification for the TranslatorPluginManager with the ServiceListener.
*
* @param \Zend\ModuleManager\ModuleEvent
* @param \Zend\ModuleManager\ModuleManager $moduleManager
* @return void
*/
public function init($event)
public function init($moduleManager)
{
$event = $moduleManager->getEvent();
$container = $event->getParam('ServiceManager');
$serviceListener = $container->get('ServiceListener');

Expand Down
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 d5ce2dc

Please sign in to comment.