-
Notifications
You must be signed in to change notification settings - Fork 89
Test for v2-v3 PluginManager migration #81
Test for v2-v3 PluginManager migration #81
Conversation
"I'm going mad." Jokes apart, seems indeed to be the case :-\ https://travis-ci.org/zendframework/zend-servicemanager/jobs/104510819#L316 The entire aliases system in 2.x was quite of a mess. Is this issue just about the portability components? |
Yes - just trying to follow the docs. Well, I can see two solutions - migrators alias the 'namespaceclassname' as well as the full name, or SM looks up factories twice. As someone doing migrations I know which I'd prefer 😉 |
@kynx, |
OK, think I've found the magic sauce. In v2.7 and v3, the plugin manager is never configured. If I override the constructor to do that, it works: public function __construct($configInstanceOrParentLocator = null, array $config = [])
{
parent::__construct($configInstanceOrParentLocator, $config);
$config = new Config(['aliases' => $this->aliases, 'factories' => $this->factories]);
$config->configureServiceManager($this);
} In v3, it would be something like: public function __construct($configInstanceOrParentLocator = null, array $config = [])
{
parent::__construct($configInstanceOrParentLocator, $config);
$this->configure(['aliases' => $this->aliases, 'factories' => $this->factories]);
} Should that be happening by default in |
Scratch the above - I've added the canonicalized entry for the factory to the test and it passes. Yay! Now if only it worked as well in v3. See #87 |
Test for v2-v3 PluginManager migration
I'm sure I'm doing something really, really dumb, but I'm trying to follow the migration docs and from what I've read this test should pass. Instead I get:
From what I can tell ServiceManager v2 is still looking up factories by their canonicalised name, which would work with:
...but not when defined in the
alias
andfactories
properties.Please tell me I'm going mad.