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

Commit a742faf

Browse files
committed
Ensure parent manager is injected under v3
- Modified the condition for pulling the parent locator to test against the v3 `configure` method instead; `getServiceLocator()` also exists in v3, but emits a deprecation notice. - Modified the test for the behavior to work under both versions. The expected behavior is the same, given the same configuration.
1 parent d93331b commit a742faf

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/Helper/Navigation/PluginManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct($configOrContainerInstance = null, array $v3config =
8686
// set the service locator to the parent locator.
8787
//
8888
// Under v3, the parent locator is what is passed to the method already.
89-
if (method_exists($container, 'getServiceLocator') && $container->getServiceLocator()) {
89+
if (! method_exists($container, 'configure') && $container->getServiceLocator()) {
9090
$container = $container->getServiceLocator();
9191
}
9292

test/Helper/Navigation/PluginManagerCompatibilityTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,8 @@ public function testConstructorAllowsConfigInstanceAsFirstArgumentUnderV2()
6767
$this->assertInstanceOf(PluginManager::class, $helpers);
6868
}
6969

70-
public function testInjectsParentContainerIntoHelpersUnderV2()
70+
public function testInjectsParentContainerIntoHelpers()
7171
{
72-
$helpers = $this->getPluginManager();
73-
if (method_exists($helpers, 'configure')) {
74-
$this->markTestSkipped('This test is specific to v2 functionality');
75-
}
76-
7772
$config = new Config([
7873
'navigation' => [
7974
'default' => [],

0 commit comments

Comments
 (0)