-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
253 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; | ||
use Zend\ServiceManager\Factory\InvokableFactory; | ||
|
||
return [ | ||
'service_manager' => [ | ||
'factories' => [ | ||
'MyService' => InvokableFactory::class, | ||
], | ||
'abstract_factories' => [ | ||
ConfigAbstractFactory::class, | ||
'Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory', | ||
], | ||
], | ||
|
||
'dependencies' => [ | ||
'factories' => [ | ||
'MyService' => InvokableFactory::class, | ||
], | ||
'abstract_factories' => [ | ||
ConfigAbstractFactory::class, | ||
'Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory', | ||
], | ||
], | ||
]; |
26 changes: 26 additions & 0 deletions
26
test/TestAsset/ConfigPostProcessor/AbstractFactories.php.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; | ||
use Laminas\ServiceManager\Factory\InvokableFactory; | ||
|
||
return [ | ||
'service_manager' => [ | ||
'factories' => [ | ||
'MyService' => InvokableFactory::class, | ||
], | ||
'abstract_factories' => [ | ||
ConfigAbstractFactory::class, | ||
'Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory', | ||
], | ||
], | ||
|
||
'dependencies' => [ | ||
'factories' => [ | ||
'MyService' => InvokableFactory::class, | ||
], | ||
'abstract_factories' => [ | ||
ConfigAbstractFactory::class, | ||
'Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory', | ||
], | ||
], | ||
]; |
42 changes: 42 additions & 0 deletions
42
test/TestAsset/ConfigPostProcessor/FullServiceManagerConfiguration.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
return [ | ||
'service_manager' => [ | ||
'abstract_factories' => [ | ||
'Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory', | ||
], | ||
'aliases' => [ | ||
'Zend\Cache\Storage\StorageInterface' => 'Zend\Cache\Storage\Adapter\Redis', | ||
], | ||
'delegators' => [ | ||
'Zend\Cache\Storage\Adapter\Redis' => [ | ||
'Zend\ServiceManager\Proxy\LazyServiceFactory', | ||
], | ||
], | ||
'factories' => [ | ||
'Zend\Form\Factory' => 'Some\Vendor\Zend\Form\ZendFormFactory', | ||
'MyService' => 'Zend\ServiceManager\Factory\InvokableFactory', | ||
], | ||
'initializers' => [ | ||
// Just for testing purposes, this initializer does not exist | ||
'Zend\Form\FactoryInitializer', | ||
], | ||
'invokables' => [ | ||
'Zend\Expressive\Router\RouterInterface' => 'MyService', | ||
], | ||
'lazy_services' => [ | ||
'class_map' => [ | ||
'Zend\Cache\Storage\Adapter\Redis' => 'Zend\Cache\Storage\Adapter\Redis', | ||
], | ||
], | ||
'services' => [ | ||
// NOTE: this is an invalid configuration, you have to provide service instances in this array. | ||
// For testing purposes, we have to change this to a string we can use to verify that the value | ||
// is not touched at all. Using instances would lead to | ||
'Zend\Cache\Storage\Adapter\Redis' => 'Zend\Cache\Storage\Adapter\Redis', | ||
], | ||
'shared' => [ | ||
'Zend\Form\Factory' => false, | ||
], | ||
], | ||
]; |
43 changes: 43 additions & 0 deletions
43
test/TestAsset/ConfigPostProcessor/FullServiceManagerConfiguration.php.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
return [ | ||
'service_manager' => [ | ||
'abstract_factories' => [ | ||
'Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory', | ||
], | ||
'aliases' => [ | ||
'Zend\Cache\Storage\StorageInterface' => 'Laminas\Cache\Storage\StorageInterface', | ||
'Laminas\Cache\Storage\StorageInterface' => 'Laminas\Cache\Storage\Adapter\Redis', | ||
'Zend\Expressive\Router\RouterInterface' => 'Mezzio\Router\RouterInterface', | ||
'Zend\Form\Factory' => 'Laminas\Form\Factory', | ||
|
||
], | ||
'delegators' => [ | ||
'Laminas\Cache\Storage\Adapter\Redis' => [ | ||
'Laminas\ServiceManager\Proxy\LazyServiceFactory', | ||
], | ||
], | ||
'factories' => [ | ||
'MyService' => 'Laminas\ServiceManager\Factory\InvokableFactory', | ||
'Laminas\Form\Factory' => 'Some\Vendor\Zend\Form\ZendFormFactory', | ||
], | ||
'initializers' => [ | ||
// Just for testing purposes, this initializer does not exist | ||
'Laminas\Form\FactoryInitializer', | ||
], | ||
'invokables' => [ | ||
'Mezzio\Router\RouterInterface' => 'MyService', | ||
], | ||
'lazy_services' => [ | ||
'class_map' => [ | ||
'Laminas\Cache\Storage\Adapter\Redis' => 'Laminas\Cache\Storage\Adapter\Redis', | ||
], | ||
], | ||
'services' => [ | ||
'Laminas\Cache\Storage\Adapter\Redis' => 'Zend\Cache\Storage\Adapter\Redis', | ||
], | ||
'shared' => [ | ||
'Laminas\Form\Factory' => false, | ||
], | ||
], | ||
]; |
17 changes: 17 additions & 0 deletions
17
test/TestAsset/ConfigPostProcessor/InvalidServiceManagerConfiguration.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
return [ | ||
'service_manager' => [ | ||
'aliases' => [ | ||
'MyAlias' => 'MyOtherService', | ||
], | ||
'factories' => [ | ||
'MyOtherService', 'MyOtherFactory', | ||
'MyOtherService' => 'MyOtherFactory', | ||
], | ||
'invokables' => [ | ||
'Foo', 'Bar', | ||
'Foo' => 'Bar', | ||
], | ||
], | ||
]; |
17 changes: 17 additions & 0 deletions
17
test/TestAsset/ConfigPostProcessor/InvalidServiceManagerConfiguration.php.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
return [ | ||
'service_manager' => [ | ||
'aliases' => [ | ||
'MyAlias' => 'MyOtherService', | ||
], | ||
'factories' => [ | ||
'MyOtherService', 'MyOtherFactory', | ||
'MyOtherService' => 'MyOtherFactory', | ||
], | ||
'invokables' => [ | ||
'Foo', 'Bar', | ||
'Foo' => 'Bar', | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
use Zend\ServiceManager\Factory\InvokableFactory; | ||
use Zend\ServiceManager\Proxy\LazyServiceFactory; | ||
|
||
return [ | ||
'dependencies' => [ | ||
'factories' => [ | ||
'Zend\Db\Adapter\Adapter' => 'Zend\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory', | ||
], | ||
'lazy_services' => [ | ||
// Mapping services to their class names is required | ||
// since the ServiceManager is not a declarative DIC. | ||
'class_map' => [ | ||
'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\Adapter', | ||
], | ||
], | ||
'delegators' => [ | ||
'Zend\Db\Adapter\Adapter' => [ | ||
LazyServiceFactory::class, | ||
], | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Laminas\ServiceManager\Factory\InvokableFactory; | ||
use Laminas\ServiceManager\Proxy\LazyServiceFactory; | ||
|
||
return [ | ||
'dependencies' => [ | ||
'factories' => [ | ||
'Laminas\Db\Adapter\Adapter' => 'Laminas\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory', | ||
], | ||
'lazy_services' => [ | ||
// Mapping services to their class names is required | ||
// since the ServiceManager is not a declarative DIC. | ||
'class_map' => [ | ||
'Laminas\Db\Adapter\Adapter' => 'Laminas\Db\Adapter\Adapter', | ||
], | ||
], | ||
'delegators' => [ | ||
'Laminas\Db\Adapter\Adapter' => [ | ||
LazyServiceFactory::class, | ||
], | ||
], | ||
'aliases' => [ | ||
'Zend\Db\Adapter\Adapter' => 'Laminas\Db\Adapter\Adapter' | ||
], | ||
], | ||
]; |