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

Commit 02562f6

Browse files
committed
Merge branch 'hotfix/101' into develop
Forward port #97
2 parents 414cd83 + 657eab0 commit 02562f6

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All notable changes to this project will be documented in this file, in reverse
2020

2121
- Nothing.
2222

23-
## 2.7.3 - TBD
23+
## 2.7.3 - 2016-03-08
2424

2525
### Added
2626

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

3737
### Fixed
3838

39-
- Nothing.
39+
- [#97](https://github.com/zendframework/zend-mvc/pull/97) re-introduces the
40+
`ServiceManager` factory definition inside `ServiceManagerConfig`, to ensure
41+
backwards compatibility.
4042

4143
## 2.7.2 - 2016-03-08
4244

src/Service/ServiceManagerConfig.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ class ServiceManagerConfig extends Config
7676
*/
7777
public function __construct(array $config = [])
7878
{
79+
$this->config['factories']['ServiceManager'] = function ($container) {
80+
return $container;
81+
};
82+
7983
$this->config['factories']['SharedEventManager'] = function () {
8084
return new SharedEventManager();
8185
};

test/Service/ServiceManagerConfigTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,17 @@ public function testEventManagerInitializerCanBeReplaced()
212212

213213
$serviceManager->get('EventManagerAware');
214214
}
215+
216+
/**
217+
* @group 101
218+
*/
219+
public function testCreatesAFactoryForTheServiceManagerThatReturnsIt()
220+
{
221+
$serviceManager = new ServiceManager();
222+
$config = new ServiceManagerConfig();
223+
$config->configureServiceManager($serviceManager);
224+
225+
$this->assertTrue($serviceManager->has('ServiceManager'), 'Missing ServiceManager service!');
226+
$this->assertSame($serviceManager, $serviceManager->get('ServiceManager'));
227+
}
215228
}

0 commit comments

Comments
 (0)