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

Commit 90fbfbc

Browse files
committed
Merge branch 'hotfix/101'
Close #97 Fixes zendframework/zend-servicemanager#101
2 parents d4661db + 657eab0 commit 90fbfbc

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
@@ -2,7 +2,7 @@
22

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

5-
## 2.7.3 - TBD
5+
## 2.7.3 - 2016-03-08
66

77
### Added
88

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

1919
### Fixed
2020

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

2325
## 2.7.2 - 2016-03-08
2426

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)