From a2f8a9ef1ffc66c1e69d14e34210646e2ac4a934 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 31 Dec 2019 11:43:51 -0600 Subject: [PATCH] Rewriting as Laminas Project package --- .gitattributes | 14 +- .gitignore | 19 +- .travis.yml | 3 - CONTRIBUTING.md | 229 ------------ COPYRIGHT.md | 2 + LICENSE.txt => LICENSE.md | 22 +- README.md | 8 +- composer.json | 51 ++- phpunit.xml.dist | 6 +- phpunit.xml.travis | 6 +- src/AbstractFactoryInterface.php | 11 +- src/AbstractPluginManager.php | 11 +- src/Config.php | 11 +- src/ConfigInterface.php | 11 +- src/DelegatorFactoryInterface.php | 11 +- src/Di/DiAbstractServiceFactory.php | 21 +- src/Di/DiInstanceManagerProxy.php | 15 +- src/Di/DiServiceFactory.php | 29 +- src/Di/DiServiceInitializer.php | 23 +- .../CircularDependencyFoundException.php | 11 +- src/Exception/CircularReferenceException.php | 11 +- src/Exception/ExceptionInterface.php | 11 +- src/Exception/InvalidArgumentException.php | 11 +- src/Exception/InvalidServiceNameException.php | 11 +- src/Exception/RuntimeException.php | 11 +- .../ServiceLocatorUsageException.php | 15 +- src/Exception/ServiceNotCreatedException.php | 11 +- src/Exception/ServiceNotFoundException.php | 11 +- src/FactoryInterface.php | 11 +- src/InitializerInterface.php | 11 +- src/MutableCreationOptionsInterface.php | 11 +- src/MutableCreationOptionsTrait.php | 11 +- src/Proxy/LazyServiceFactory.php | 17 +- src/Proxy/LazyServiceFactoryFactory.php | 21 +- src/ServiceLocatorAwareInterface.php | 11 +- src/ServiceLocatorAwareTrait.php | 11 +- src/ServiceLocatorInterface.php | 11 +- src/ServiceManager.php | 17 +- src/ServiceManagerAwareInterface.php | 11 +- test/AbstractPluginManagerTest.php | 67 ++-- test/Di/DiAbstractServiceFactoryTest.php | 43 ++- test/Di/DiServiceFactoryTest.php | 35 +- test/Di/DiServiceInitializerTest.php | 29 +- .../ServiceLocatorUsageExceptionTest.php | 29 +- test/MutableCreationOptionsTraitTest.php | 13 +- test/Proxy/LazyServiceFactoryFactoryTest.php | 39 +- test/Proxy/LazyServiceFactoryTest.php | 23 +- test/ServiceLocatorAwareTraitTest.php | 19 +- test/ServiceManagerTest.php | 333 +++++++++--------- ...tractFactoryWithMutableCreationOptions.php | 17 +- test/TestAsset/Bar.php | 11 +- test/TestAsset/BarAbstractFactory.php | 15 +- .../CallableWithMutableCreationOptions.php | 15 +- .../CircularDependencyAbstractFactory.php | 15 +- test/TestAsset/ExceptionThrowingFactory.php | 15 +- test/TestAsset/Foo.php | 11 +- test/TestAsset/FooAbstractFactory.php | 15 +- test/TestAsset/FooCounterAbstractFactory.php | 15 +- test/TestAsset/FooException.php | 11 +- test/TestAsset/FooFactory.php | 17 +- test/TestAsset/FooFake.php | 11 +- test/TestAsset/FooFakeAbstractFactory.php | 15 +- test/TestAsset/FooInitializer.php | 15 +- test/TestAsset/FooPluginManager.php | 13 +- test/TestAsset/GlobIteratorService.php | 11 +- .../MockSelfReturningDelegatorFactory.php | 15 +- test/TestAsset/TrollAbstractFactory.php | 15 +- test/TestAsset/WaitingAbstractFactory.php | 15 +- test/bootstrap.php | 13 +- 69 files changed, 690 insertions(+), 969 deletions(-) delete mode 100644 CONTRIBUTING.md create mode 100644 COPYRIGHT.md rename LICENSE.txt => LICENSE.md (54%) diff --git a/.gitattributes b/.gitattributes index 85dc9a8c..1abdf0f4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,8 @@ -/test export-ignore -/vendor export-ignore -.gitattributes export-ignore -.gitignore export-ignore -.travis.yml export-ignore -.php_cs export-ignore +/.coveralls.yml export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.php_cs export-ignore +/.travis.yml export-ignore +/phpunit.xml.dist export-ignore +/phpunit.xml.travis export-ignore +/test/ export-ignore diff --git a/.gitignore b/.gitignore index 4cac0a21..d5e33e78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,5 @@ -.buildpath -.DS_Store -.idea -.project -.settings/ -.*.sw* -.*.un~ -nbproject -tmp/ - -clover.xml -coveralls-upload.json -phpunit.xml -vendor +/clover.xml +/composer.lock +/coveralls-upload.json +/phpunit.xml +/vendor/ diff --git a/.travis.yml b/.travis.yml index fe909ecb..a2f410ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -sudo: false - language: php matrix: @@ -17,7 +15,6 @@ matrix: - php: hhvm notifications: - irc: "irc.freenode.org#zftalk.dev" email: false before_install: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 608075d4..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,229 +0,0 @@ -# CONTRIBUTING - -## RESOURCES - -If you wish to contribute to Zend Framework, please be sure to -read/subscribe to the following resources: - - - [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards) - - [Contributor's Guide](http://framework.zend.com/participate/contributor-guide) - - ZF Contributor's mailing list: - Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html - Subscribe: zf-contributors-subscribe@lists.zend.com - - ZF Contributor's IRC channel: - #zftalk.dev on Freenode.net - -If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-service-manager/issues/new). - -## Reporting Potential Security Issues - -If you have encountered a potential security vulnerability, please **DO NOT** report it on the public -issue tracker: send it to us at [zf-security@zend.com](mailto:zf-security@zend.com) instead. -We will work with you to verify the vulnerability and patch it as soon as possible. - -When reporting issues, please provide the following information: - -- Component(s) affected -- A description indicating how to reproduce the issue -- A summary of the security vulnerability and impact - -We request that you contact us via the email address above and give the project -contributors a chance to resolve the vulnerability and issue a new release prior -to any public exposure; this helps protect users and provides them with a chance -to upgrade and/or update in order to protect their applications. - -For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc). - -## RUNNING TESTS - -> ### Note: testing versions prior to 2.4 -> -> This component originates with Zend Framework 2. During the lifetime of ZF2, -> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no -> changes were necessary. However, due to the migration, tests may not run on -> versions < 2.4. As such, you may need to change the PHPUnit dependency if -> attempting a fix on such a version. - -To run tests: - -- Clone the repository: - - ```console - $ git clone git@github.com:zendframework/zend-service-manager.git - $ cd - ``` - -- Install dependencies via composer: - - ```console - $ curl -sS https://getcomposer.org/installer | php -- - $ ./composer.phar install - ``` - - If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/ - -- Run the tests via `phpunit` and the provided PHPUnit config, like in this example: - - ```console - $ ./vendor/bin/phpunit - ``` - -You can turn on conditional tests with the phpunit.xml file. -To do so: - - - Copy `phpunit.xml.dist` file to `phpunit.xml` - - Edit `phpunit.xml` to enable any specific functionality you - want to test, as well as to provide test values to utilize. - -## Running Coding Standards Checks - -This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding -standards checks, and provides configuration for our selected checks. -`php-cs-fixer` is installed by default via Composer. - -To run checks only: - -```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs -``` - -To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run` -flag: - -```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs -``` - -If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure -they pass, and make sure you add and commit the changes after verification. - -## Recommended Workflow for Contributions - -Your first step is to establish a public repository from which we can -pull your work into the master repository. We recommend using -[GitHub](https://github.com), as that is where the component is already hosted. - -1. Setup a [GitHub account](http://github.com/), if you haven't yet -2. Fork the repository (http://github.com/zendframework/zend-service-manager) -3. Clone the canonical repository locally and enter it. - - ```console - $ git clone git://github.com:zendframework/zend-service-manager.git - $ cd zend-service-manager - ``` - -4. Add a remote to your fork; substitute your GitHub username in the command - below. - - ```console - $ git remote add {username} git@github.com:{username}/zend-service-manager.git - $ git fetch {username} - ``` - -### Keeping Up-to-Date - -Periodically, you should update your fork or personal repository to -match the canonical ZF repository. Assuming you have setup your local repository -per the instructions above, you can do the following: - - -```console -$ git checkout master -$ git fetch origin -$ git rebase origin/master -# OPTIONALLY, to keep your remote up-to-date - -$ git push {username} master:master -``` - -If you're tracking other branches -- for example, the "develop" branch, where -new feature development occurs -- you'll want to do the same operations for that -branch; simply substitute "develop" for "master". - -### Working on a patch - -We recommend you do each new feature or bugfix in a new branch. This simplifies -the task of code review as well as the task of merging your changes into the -canonical repository. - -A typical workflow will then consist of the following: - -1. Create a new local branch based off either your master or develop branch. -2. Switch to your new local branch. (This step can be combined with the - previous step with the use of `git checkout -b`.) -3. Do some work, commit, repeat as necessary. -4. Push the local branch to your remote repository. -5. Send a pull request. - -The mechanics of this process are actually quite trivial. Below, we will -create a branch for fixing an issue in the tracker. - -```console -$ git checkout -b hotfix/9295 -Switched to a new branch 'hotfix/9295' -``` - -... do some work ... - - -```console -$ git commit -``` - -... write your log message ... - - -```console -$ git push {username} hotfix/9295:hotfix/9295 -Counting objects: 38, done. -Delta compression using up to 2 threads. -Compression objects: 100% (18/18), done. -Writing objects: 100% (20/20), 8.19KiB, done. -Total 20 (delta 12), reused 0 (delta 0) -To ssh://git@github.com/{username}/zend-service-manager.git - b5583aa..4f51698 HEAD -> master -``` - -To send a pull request, you have two options. - -If using GitHub, you can do the pull request from there. Navigate to -your repository, select the branch you just created, and then select the -"Pull Request" button in the upper right. Select the user/organization -"zendframework" as the recipient. - -If using your own repository - or even if using GitHub - you can use `git -format-patch` to create a patchset for us to apply; in fact, this is -**recommended** for security-related patches. If you use `format-patch`, please -send the patches as attachments to: - -- zf-devteam@zend.com for patches without security implications -- zf-security@zend.com for security patches - -#### What branch to issue the pull request against? - -Which branch should you issue a pull request against? - -- For fixes against the stable release, issue the pull request against the - "master" branch. -- For new features, or fixes that introduce new elements to the public API (such - as new public methods or properties), issue the pull request against the - "develop" branch. - -### Branch Cleanup - -As you might imagine, if you are a frequent contributor, you'll start to -get a ton of branches both locally and on your remote. - -Once you know that your changes have been accepted to the master -repository, we suggest doing some cleanup of these branches. - -- Local branch cleanup - - ```console - $ git branch -d - ``` - -- Remote branch removal - - ```console - $ git push {username} : - ``` diff --git a/COPYRIGHT.md b/COPYRIGHT.md new file mode 100644 index 00000000..c4fc4fee --- /dev/null +++ b/COPYRIGHT.md @@ -0,0 +1,2 @@ +Copyright (c) 2019, Laminas Foundation. +All rights reserved. (https://getlaminas.org/) diff --git a/LICENSE.txt b/LICENSE.md similarity index 54% rename from LICENSE.txt rename to LICENSE.md index 6eab5aa1..09f53edc 100644 --- a/LICENSE.txt +++ b/LICENSE.md @@ -1,19 +1,19 @@ -Copyright (c) 2005-2015, Zend Technologies USA, Inc. +Copyright (c) 2019, Laminas Foundation All rights reserved. -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. - * Neither the name of Zend Technologies USA, Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. +- Neither the name of Laminas Foundation nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/README.md b/README.md index 7c8a5f17..e4b9047d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# zend-servicemanager +# laminas-servicemanager -The Service Locator design pattern is implemented by the `Zend\ServiceManager` +The Service Locator design pattern is implemented by the `Laminas\ServiceManager` component. The Service Locator is a service/object locator, tasked with retrieving other objects. -- File issues at https://github.com/zendframework/zend-servicemanager/issues -- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-servicemanager +- File issues at https://github.com/laminas/laminas-servicemanager/issues +- Documentation is at https://docs.laminas.dev/laminas-servicemanager diff --git a/composer.json b/composer.json index 116cf1e5..43fdae22 100644 --- a/composer.json +++ b/composer.json @@ -1,39 +1,54 @@ { - "name": "zendframework/zend-servicemanager", + "name": "laminas/laminas-servicemanager", "description": " ", "license": "BSD-3-Clause", "keywords": [ - "zf2", + "laminas", "servicemanager" ], - "homepage": "https://github.com/zendframework/zend-service-manager", - "autoload": { - "psr-4": { - "Zend\\ServiceManager\\": "src/" + "homepage": "https://laminas.dev", + "support": { + "docs": "https://docs.laminas.dev/laminas-servicemanager/", + "issues": "https://github.com/laminas/laminas-servicemanager/issues", + "source": "https://github.com/laminas/laminas-servicemanager", + "rss": "https://github.com/laminas/laminas-servicemanager/releases.atom", + "chat": "https://laminas.dev/chat", + "forum": "https://discourse.laminas.dev" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" } }, "require": { - "php": ">=5.3.23" + "php": ">=5.3.23", + "laminas/laminas-zendframework-bridge": "^1.0" }, "require-dev": { - "zendframework/zend-di": "self.version", "fabpot/php-cs-fixer": "1.7.*", - "satooshi/php-coveralls": "dev-master", - "phpunit/PHPUnit": "~4.0" + "laminas/laminas-di": "self.version", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "dev-master" }, "suggest": { - "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", - "zendframework/zend-di": "Zend\\Di component" + "laminas/laminas-di": "Laminas\\Di component", + "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services" }, - "extra": { - "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" + "autoload": { + "psr-4": { + "Laminas\\ServiceManager\\": "src/" } }, "autoload-dev": { "psr-4": { - "ZendTest\\ServiceManager\\": "test/" + "LaminasTest\\ServiceManager\\": "test/" } + }, + "replace": { + "zendframework/zend-servicemanager": "self.version" } -} \ No newline at end of file +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 31e7b179..81c29e2c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,7 +4,7 @@ bootstrap="./test/bootstrap.php" colors="true"> - + ./test/ @@ -26,9 +26,9 @@ - + diff --git a/phpunit.xml.travis b/phpunit.xml.travis index 31e7b179..81c29e2c 100644 --- a/phpunit.xml.travis +++ b/phpunit.xml.travis @@ -4,7 +4,7 @@ bootstrap="./test/bootstrap.php" colors="true"> - + ./test/ @@ -26,9 +26,9 @@ - + diff --git a/src/AbstractFactoryInterface.php b/src/AbstractFactoryInterface.php index 96bffea8..a41feaa8 100644 --- a/src/AbstractFactoryInterface.php +++ b/src/AbstractFactoryInterface.php @@ -1,13 +1,12 @@ = 5.3.23 + * @deprecated since laminas 2.3 requires PHP >= 5.3.23 * * @param string $className * @param string $type * @return bool * - * @deprecated this method is being deprecated as of zendframework 2.2, and may be removed in future major versions + * @deprecated this method is being deprecated as of laminas 2.2, and may be removed in future major versions */ protected static function isSubclassOf($className, $type) { diff --git a/src/ServiceManagerAwareInterface.php b/src/ServiceManagerAwareInterface.php index 2519bbaf..b64640ff 100644 --- a/src/ServiceManagerAwareInterface.php +++ b/src/ServiceManagerAwareInterface.php @@ -1,13 +1,12 @@ serviceManager = new ServiceManager(); $this->pluginManager = new FooPluginManager(new Config(array( 'factories' => array( - 'Foo' => 'ZendTest\ServiceManager\TestAsset\FooFactory', + 'Foo' => 'LaminasTest\ServiceManager\TestAsset\FooFactory', ), 'shared' => array( 'Foo' => false, @@ -46,7 +45,7 @@ public function testSetMultipleCreationOptions() { $pluginManager = new FooPluginManager(new Config(array( 'factories' => array( - 'Foo' => 'ZendTest\ServiceManager\TestAsset\FooFactory' + 'Foo' => 'LaminasTest\ServiceManager\TestAsset\FooFactory' ), 'shared' => array( 'Foo' => false @@ -63,13 +62,13 @@ public function testSetMultipleCreationOptions() $pluginManager->get('Foo', array('key1' => 'value1')); $value = $reflProperty->getValue($pluginManager); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\FooFactory', $value['foo']); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\FooFactory', $value['foo']); $this->assertEquals(array('key1' => 'value1'), $value['foo']->getCreationOptions()); $pluginManager->get('Foo', array('key2' => 'value2')); $value = $reflProperty->getValue($pluginManager); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\FooFactory', $value['foo']); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\FooFactory', $value['foo']); $this->assertEquals(array('key2' => 'value2'), $value['foo']->getCreationOptions()); } @@ -78,7 +77,7 @@ public function testSetMultipleCreationOptions() */ public function testGetFaultyRegisteredInvokableThrowsException() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $pluginManager = new FooPluginManager(); $pluginManager->setInvokableClass('helloWorld', 'IDoNotExist'); @@ -88,7 +87,7 @@ public function testGetFaultyRegisteredInvokableThrowsException() public function testAbstractFactoryWithMutableCreationOptions() { $creationOptions = array('key1' => 'value1'); - $mock = 'ZendTest\ServiceManager\TestAsset\AbstractFactoryWithMutableCreationOptions'; + $mock = 'LaminasTest\ServiceManager\TestAsset\AbstractFactoryWithMutableCreationOptions'; $abstractFactory = $this->getMock($mock, array('setCreationOptions')); $abstractFactory->expects($this->once()) ->method('setCreationOptions') @@ -101,7 +100,7 @@ public function testAbstractFactoryWithMutableCreationOptions() public function testMutableMethodNeverCalledWithoutCreationOptions() { - $mock = 'ZendTest\ServiceManager\TestAsset\CallableWithMutableCreationOptions'; + $mock = 'LaminasTest\ServiceManager\TestAsset\CallableWithMutableCreationOptions'; $callable = $this->getMock($mock, array('setCreationOptions')); $callable->expects($this->never()) ->method('setCreationOptions'); @@ -116,7 +115,7 @@ public function testMutableMethodNeverCalledWithoutCreationOptions() public function testCallableObjectWithMutableCreationOptions() { $creationOptions = array('key1' => 'value1'); - $mock = 'ZendTest\ServiceManager\TestAsset\CallableWithMutableCreationOptions'; + $mock = 'LaminasTest\ServiceManager\TestAsset\CallableWithMutableCreationOptions'; $callable = $this->getMock($mock, array('setCreationOptions')); $callable->expects($this->once()) ->method('setCreationOptions') @@ -135,8 +134,8 @@ public function testCallableObjectWithMutableCreationOptions() public function testValidatePluginIsCalledWithDelegatorFactoryIfItsAService() { - $pluginManager = $this->getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager'); - $delegatorFactory = $this->getMock('Zend\\ServiceManager\\DelegatorFactoryInterface'); + $pluginManager = $this->getMockForAbstractClass('Laminas\ServiceManager\AbstractPluginManager'); + $delegatorFactory = $this->getMock('Laminas\\ServiceManager\\DelegatorFactoryInterface'); $pluginManager->setService('delegator-factory', $delegatorFactory); $pluginManager->addDelegator('foo-service', 'delegator-factory'); @@ -150,9 +149,9 @@ public function testValidatePluginIsCalledWithDelegatorFactoryIfItsAService() public function testSingleDelegatorUsage() { - $delegatorFactory = $this->getMock('Zend\\ServiceManager\\DelegatorFactoryInterface'); - /* @var $pluginManager \Zend\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject */ - $pluginManager = $this->getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager'); + $delegatorFactory = $this->getMock('Laminas\\ServiceManager\\DelegatorFactoryInterface'); + /* @var $pluginManager \Laminas\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject */ + $pluginManager = $this->getMockForAbstractClass('Laminas\ServiceManager\AbstractPluginManager'); $realService = $this->getMock('stdClass', array(), array(), 'RealService'); $delegator = $this->getMock('stdClass', array(), array(), 'Delegator'); @@ -187,8 +186,8 @@ public function testSingleDelegatorUsage() public function testMultipleDelegatorsUsage() { - /* @var $pluginManager \Zend\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject */ - $pluginManager = $this->getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager'); + /* @var $pluginManager \Laminas\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject */ + $pluginManager = $this->getMockForAbstractClass('Laminas\ServiceManager\AbstractPluginManager'); $fooDelegator = new MockSelfReturningDelegatorFactory(); $barDelegator = new MockSelfReturningDelegatorFactory(); @@ -216,15 +215,15 @@ public function testCanCheckInvalidServiceManagerIsUsed() $sm = new ServiceManager(); $sm->setService('bar', new \stdClass()); - /** @var \Zend\ServiceManager\AbstractPluginManager $pluginManager */ + /** @var \Laminas\ServiceManager\AbstractPluginManager $pluginManager */ $pluginManager = new FooPluginManager(); $pluginManager->setServiceLocator($sm); - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceLocatorUsageException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceLocatorUsageException'); $pluginManager->get('bar'); - $this->fail('A Zend\ServiceManager\Exception\ServiceNotCreatedException is expected'); + $this->fail('A Laminas\ServiceManager\Exception\ServiceNotCreatedException is expected'); } /** @@ -236,8 +235,8 @@ public function testWillRethrowOnNonValidatedPlugin() $sm->setInvokableClass('stdClass', 'stdClass'); - /** @var \Zend\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject $pluginManager */ - $pluginManager = $this->getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager'); + /** @var \Laminas\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject $pluginManager */ + $pluginManager = $this->getMockForAbstractClass('Laminas\ServiceManager\AbstractPluginManager'); $pluginManager ->expects($this->once()) @@ -247,7 +246,7 @@ public function testWillRethrowOnNonValidatedPlugin() $pluginManager->setServiceLocator($sm); - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceLocatorUsageException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceLocatorUsageException'); $pluginManager->get('stdClass'); } @@ -257,8 +256,8 @@ public function testWillRethrowOnNonValidatedPlugin() */ public function testWillResetAutoInvokableServiceIfNotValid() { - /** @var \Zend\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject $pluginManager */ - $pluginManager = $this->getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager'); + /** @var \Laminas\ServiceManager\AbstractPluginManager|\PHPUnit_Framework_MockObject_MockObject $pluginManager */ + $pluginManager = $this->getMockForAbstractClass('Laminas\ServiceManager\AbstractPluginManager'); $pluginManager ->expects($this->any()) diff --git a/test/Di/DiAbstractServiceFactoryTest.php b/test/Di/DiAbstractServiceFactoryTest.php index 60dcae33..a3d7f084 100644 --- a/test/Di/DiAbstractServiceFactoryTest.php +++ b/test/Di/DiAbstractServiceFactoryTest.php @@ -1,19 +1,18 @@ addSharedInstance($this->fooInstance = new \stdClass(), 'foo'); - $this->mockDi = $this->getMock('Zend\Di\Di', array(), array(null, $instanceManager)); - $this->mockServiceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); + $this->mockDi = $this->getMock('Laminas\Di\Di', array(), array(null, $instanceManager)); + $this->mockServiceLocator = $this->getMock('Laminas\ServiceManager\ServiceLocatorInterface'); $this->diAbstractServiceFactory = new DiAbstractServiceFactory( $this->mockDi ); @@ -44,21 +43,21 @@ public function setup() /** - * @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::__construct + * @covers Laminas\ServiceManager\Di\DiAbstractServiceFactory::__construct */ public function testConstructor() { $instance = new DiAbstractServiceFactory( - $this->getMock('Zend\Di\Di') + $this->getMock('Laminas\Di\Di') ); - $this->assertInstanceOf('Zend\ServiceManager\Di\DiAbstractServiceFactory', $instance); + $this->assertInstanceOf('Laminas\ServiceManager\Di\DiAbstractServiceFactory', $instance); } /** * @group 6021 * - * @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::createServiceWithName - * @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::get + * @covers Laminas\ServiceManager\Di\DiAbstractServiceFactory::createServiceWithName + * @covers Laminas\ServiceManager\Di\DiAbstractServiceFactory::get */ public function testCreateServiceWithNameAndWithoutRequestName() { @@ -67,8 +66,8 @@ public function testCreateServiceWithNameAndWithoutRequestName() } /** - * @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::createServiceWithName - * @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::get + * @covers Laminas\ServiceManager\Di\DiAbstractServiceFactory::createServiceWithName + * @covers Laminas\ServiceManager\Di\DiAbstractServiceFactory::get */ public function testCreateServiceWithName() { @@ -77,11 +76,11 @@ public function testCreateServiceWithName() } /** - * @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::canCreateServiceWithName + * @covers Laminas\ServiceManager\Di\DiAbstractServiceFactory::canCreateServiceWithName */ public function testCanCreateServiceWithName() { - $instance = new DiAbstractServiceFactory($this->getMock('Zend\Di\Di')); + $instance = new DiAbstractServiceFactory($this->getMock('Laminas\Di\Di')); $im = $instance->instanceManager(); $locator = new ServiceManager(); @@ -109,7 +108,7 @@ public function testCanCreateServiceWithName() // will check definitions $def = $instance->definitions(); $this->assertFalse($instance->canCreateServiceWithName($locator, __NAMESPACE__ . '\Other\Non\Existing', __NAMESPACE__ . '\Other\Non\Existing')); - $classDefinition = $this->getMock('Zend\Di\Definition\DefinitionInterface'); + $classDefinition = $this->getMock('Laminas\Di\Definition\DefinitionInterface'); $classDefinition ->expects($this->any()) ->method('hasClass') diff --git a/test/Di/DiServiceFactoryTest.php b/test/Di/DiServiceFactoryTest.php index d57984dc..8e631909 100644 --- a/test/Di/DiServiceFactoryTest.php +++ b/test/Di/DiServiceFactoryTest.php @@ -1,20 +1,19 @@ addSharedInstanceWithParameters( $this->fooInstance = new \stdClass(), 'foo', array('bar' => 'baz') ); - $this->mockDi = $this->getMock('Zend\Di\Di', array(), array(null, $instanceManager)); - $this->mockServiceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); + $this->mockDi = $this->getMock('Laminas\Di\Di', array(), array(null, $instanceManager)); + $this->mockServiceLocator = $this->getMock('Laminas\ServiceManager\ServiceLocatorInterface'); $this->diServiceFactory = new DiServiceFactory( $this->mockDi, 'foo', @@ -50,21 +49,21 @@ public function setup() } /** - * @covers Zend\ServiceManager\Di\DiServiceFactory::__construct + * @covers Laminas\ServiceManager\Di\DiServiceFactory::__construct */ public function testConstructor() { $instance = new DiServiceFactory( - $this->getMock('Zend\Di\Di'), + $this->getMock('Laminas\Di\Di'), 'string', array('foo' => 'bar') ); - $this->assertInstanceOf('Zend\ServiceManager\Di\DiServiceFactory', $instance); + $this->assertInstanceOf('Laminas\ServiceManager\Di\DiServiceFactory', $instance); } /** - * @covers Zend\ServiceManager\Di\DiServiceFactory::createService - * @covers Zend\ServiceManager\Di\DiServiceFactory::get + * @covers Laminas\ServiceManager\Di\DiServiceFactory::createService + * @covers Laminas\ServiceManager\Di\DiServiceFactory::get */ public function testCreateService() { diff --git a/test/Di/DiServiceInitializerTest.php b/test/Di/DiServiceInitializerTest.php index b42386c7..28d51132 100644 --- a/test/Di/DiServiceInitializerTest.php +++ b/test/Di/DiServiceInitializerTest.php @@ -1,19 +1,18 @@ mockDi = $this->getMock('Zend\Di\Di', array('injectDependencies')); - $this->mockServiceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); + $this->mockDi = $this->getMock('Laminas\Di\Di', array('injectDependencies')); + $this->mockServiceLocator = $this->getMock('Laminas\ServiceManager\ServiceLocatorInterface'); $this->mockDiInstanceManagerProxy = new DiInstanceManagerProxy( - $this->mockDiInstanceManager = $this->getMock('Zend\Di\InstanceManager'), + $this->mockDiInstanceManager = $this->getMock('Laminas\Di\InstanceManager'), $this->mockServiceLocator ); $this->diServiceInitializer = new DiServiceInitializer( @@ -47,7 +46,7 @@ public function setup() } /** - * @covers Zend\ServiceManager\Di\DiServiceInitializer::initialize + * @covers Laminas\ServiceManager\Di\DiServiceInitializer::initialize */ public function testInitialize() { @@ -60,12 +59,12 @@ public function testInitialize() } /** - * @covers Zend\ServiceManager\Di\DiServiceInitializer::initialize + * @covers Laminas\ServiceManager\Di\DiServiceInitializer::initialize * @todo this needs to be moved into its own class */ public function testProxyInstanceManagersStayInSync() { - $instanceManager = new \Zend\Di\InstanceManager(); + $instanceManager = new \Laminas\Di\InstanceManager(); $proxy = new DiInstanceManagerProxy($instanceManager, $this->mockServiceLocator); $instanceManager->addAlias('foo', 'bar'); diff --git a/test/Exception/ServiceLocatorUsageExceptionTest.php b/test/Exception/ServiceLocatorUsageExceptionTest.php index 6f7c693d..70d1a4a8 100644 --- a/test/Exception/ServiceLocatorUsageExceptionTest.php +++ b/test/Exception/ServiceLocatorUsageExceptionTest.php @@ -1,31 +1,30 @@ getMockForAbstractClass('Zend\ServiceManager\AbstractPluginManager'); - /* @var $serviceLocator \Zend\ServiceManager\ServiceLocatorInterface */ - $serviceLocator = $this->getMockForAbstractClass('Zend\ServiceManager\ServiceLocatorInterface'); + /* @var $pluginManager \Laminas\ServiceManager\AbstractPluginManager */ + $pluginManager = $this->getMockForAbstractClass('Laminas\ServiceManager\AbstractPluginManager'); + /* @var $serviceLocator \Laminas\ServiceManager\ServiceLocatorInterface */ + $serviceLocator = $this->getMockForAbstractClass('Laminas\ServiceManager\ServiceLocatorInterface'); $previousException = new Exception(); $exception = ServiceLocatorUsageException::fromInvalidPluginManagerRequestedServiceName( @@ -35,9 +34,9 @@ public function testFromInvalidPluginManagerRequestedServiceName() $previousException ); - $this->assertInstanceOf('Zend\ServiceManager\Exception\ServiceLocatorUsageException', $exception); + $this->assertInstanceOf('Laminas\ServiceManager\Exception\ServiceLocatorUsageException', $exception); $this->assertInstanceOf( - 'Zend\ServiceManager\Exception\ServiceNotFoundException', + 'Laminas\ServiceManager\Exception\ServiceNotFoundException', $exception, 'Must be a ServiceNotFoundException for BC compatibility with older try-catch logic' ); diff --git a/test/MutableCreationOptionsTraitTest.php b/test/MutableCreationOptionsTraitTest.php index 0c67b5ab..bb346b6d 100644 --- a/test/MutableCreationOptionsTraitTest.php +++ b/test/MutableCreationOptionsTraitTest.php @@ -1,13 +1,12 @@ markTestSkipped('Requires PHP >=5.4.0'); } - $this->stub = $this->getObjectForTrait('Zend\ServiceManager\MutableCreationOptionsTrait'); + $this->stub = $this->getObjectForTrait('Laminas\ServiceManager\MutableCreationOptionsTrait'); } public function tearDown() diff --git a/test/Proxy/LazyServiceFactoryFactoryTest.php b/test/Proxy/LazyServiceFactoryFactoryTest.php index 6f854f8c..caaee7b3 100644 --- a/test/Proxy/LazyServiceFactoryFactoryTest.php +++ b/test/Proxy/LazyServiceFactoryFactoryTest.php @@ -1,21 +1,20 @@ getMock('Zend\\ServiceManager\\ServiceLocatorInterface'); + $locator = $this->getMock('Laminas\\ServiceManager\\ServiceLocatorInterface'); $factory = new LazyServiceFactoryFactory(); $locator->expects($this->any())->method('get')->with('Config')->will($this->returnValue($config)); - $this->setExpectedException('Zend\\ServiceManager\\Exception\\InvalidArgumentException'); + $this->setExpectedException('Laminas\\ServiceManager\\Exception\\InvalidArgumentException'); $factory->createService($locator); } @@ -46,7 +45,7 @@ public function testInvalidConfiguration($config) public function testAutoGenerateProxyFiles() { $serviceManager = new ServiceManager(); - $namespace = 'ZendTestProxy' . uniqid(); + $namespace = 'LaminasTestProxy' . uniqid(); $serviceManager->setService( 'Config', @@ -58,7 +57,7 @@ public function testAutoGenerateProxyFiles() ), ) ); - $serviceManager->setFactory('foo-delegator', 'Zend\ServiceManager\Proxy\LazyServiceFactoryFactory'); + $serviceManager->setFactory('foo-delegator', 'Laminas\ServiceManager\Proxy\LazyServiceFactoryFactory'); $serviceManager->setInvokableClass('foo', __CLASS__); $serviceManager->addDelegator('foo', 'foo-delegator'); @@ -69,7 +68,7 @@ public function testAutoGenerateProxyFiles() $this->assertInstanceOf('ProxyManager\\Proxy\\LazyLoadingInterface', $proxy); $this->assertInstanceOf(__CLASS__, $proxy); $this->assertStringMatchesFormat( - $namespace . '\__PM__\ZendTest\ServiceManager\Proxy\LazyServiceFactoryFactoryTest%s', + $namespace . '\__PM__\LaminasTest\ServiceManager\Proxy\LazyServiceFactoryFactoryTest%s', $proxyClassName ); $this->assertFileExists(sys_get_temp_dir() . '/' . str_replace('\\', '', $proxyClassName) . '.php'); @@ -81,7 +80,7 @@ public function testAutoGenerateProxyFiles() public function testAutoGenerateAndEvaluateProxies() { $serviceManager = new ServiceManager(); - $namespace = 'ZendTestProxy' . uniqid(); + $namespace = 'LaminasTestProxy' . uniqid(); $serviceManager->setService( 'Config', @@ -92,7 +91,7 @@ public function testAutoGenerateAndEvaluateProxies() ), ) ); - $serviceManager->setFactory('foo-delegator', 'Zend\ServiceManager\Proxy\LazyServiceFactoryFactory'); + $serviceManager->setFactory('foo-delegator', 'Laminas\ServiceManager\Proxy\LazyServiceFactoryFactory'); $serviceManager->setInvokableClass('foo', __CLASS__); $serviceManager->addDelegator('foo', 'foo-delegator'); @@ -103,7 +102,7 @@ public function testAutoGenerateAndEvaluateProxies() $this->assertInstanceOf('ProxyManager\\Proxy\\LazyLoadingInterface', $proxy); $this->assertInstanceOf(__CLASS__, $proxy); $this->assertStringMatchesFormat( - $namespace . '\__PM__\ZendTest\ServiceManager\Proxy\LazyServiceFactoryFactoryTest%s', + $namespace . '\__PM__\LaminasTest\ServiceManager\Proxy\LazyServiceFactoryFactoryTest%s', $proxyClassName ); $this->assertFileNotExists(sys_get_temp_dir() . '/' . str_replace('\\', '', $proxyClassName) . '.php'); @@ -116,7 +115,7 @@ public function testRegistersAutoloader() { $autoloaders = spl_autoload_functions(); $serviceManager = new ServiceManager(); - $namespace = 'ZendTestProxy' . uniqid(); + $namespace = 'LaminasTestProxy' . uniqid(); $serviceManager->setService( 'Config', @@ -127,7 +126,7 @@ public function testRegistersAutoloader() ), ) ); - $serviceManager->setFactory('foo-delegator', 'Zend\ServiceManager\Proxy\LazyServiceFactoryFactory'); + $serviceManager->setFactory('foo-delegator', 'Laminas\ServiceManager\Proxy\LazyServiceFactoryFactory'); $serviceManager->create('foo-delegator'); $currentAutoloaders = spl_autoload_functions(); diff --git a/test/Proxy/LazyServiceFactoryTest.php b/test/Proxy/LazyServiceFactoryTest.php index 610c293c..b25c498e 100644 --- a/test/Proxy/LazyServiceFactoryTest.php +++ b/test/Proxy/LazyServiceFactoryTest.php @@ -1,20 +1,19 @@ markTestSkipped('Please install `ocramius/proxy-manager` to run these tests'); } - $this->locator = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface'); + $this->locator = $this->getMock('Laminas\\ServiceManager\\ServiceLocatorInterface'); $this->proxyFactory = $this ->getMockBuilder('ProxyManager\\Factory\\LazyLoadingValueHolderFactory') ->disableOriginalConstructor() @@ -80,7 +79,7 @@ public function testCannotCreateDelegatorWithNoMappedServiceClass() { $factory = new LazyServiceFactory($this->proxyFactory, array()); - $this->setExpectedException('Zend\\ServiceManager\\Exception\\InvalidServiceNameException'); + $this->setExpectedException('Laminas\\ServiceManager\\Exception\\InvalidServiceNameException'); $factory->createDelegatorWithName($this->locator, 'foo', 'baz', function () {}); } diff --git a/test/ServiceLocatorAwareTraitTest.php b/test/ServiceLocatorAwareTraitTest.php index a135d25b..b01e8587 100644 --- a/test/ServiceLocatorAwareTraitTest.php +++ b/test/ServiceLocatorAwareTraitTest.php @@ -1,26 +1,25 @@ getObjectForTrait('\Zend\ServiceManager\ServiceLocatorAwareTrait'); + $object = $this->getObjectForTrait('\Laminas\ServiceManager\ServiceLocatorAwareTrait'); $this->assertAttributeEquals(null, 'serviceLocator', $object); @@ -33,7 +32,7 @@ public function testSetServiceLocator() public function testGetServiceLocator() { - $object = $this->getObjectForTrait('\Zend\ServiceManager\ServiceLocatorAwareTrait'); + $object = $this->getObjectForTrait('\Laminas\ServiceManager\ServiceLocatorAwareTrait'); $this->assertNull($object->getServiceLocator()); diff --git a/test/ServiceManagerTest.php b/test/ServiceManagerTest.php index 9fce7db7..64bfc6ba 100644 --- a/test/ServiceManagerTest.php +++ b/test/ServiceManagerTest.php @@ -1,27 +1,26 @@ serviceManager->setFactory('foo', 'bar'); - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidServiceNameException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidServiceNameException'); $this->serviceManager->setFactory('foo', 'bar'); } /** - * @covers Zend\ServiceManager\ServiceManager::addAbstractFactory + * @covers Laminas\ServiceManager\ServiceManager::addAbstractFactory */ public function testAddAbstractFactory() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); $ret = $this->serviceManager->addAbstractFactory(new TestAsset\FooAbstractFactory()); $this->assertSame($this->serviceManager, $ret); } /** - * @covers Zend\ServiceManager\ServiceManager::addAbstractFactory + * @covers Laminas\ServiceManager\ServiceManager::addAbstractFactory */ public function testAddAbstractFactoryThrowsExceptionOnInvalidFactory() { - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidArgumentException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidArgumentException'); $this->serviceManager->addAbstractFactory(10); } @@ -129,7 +128,7 @@ public function testServiceManagerIsPassedToInitializer() } /** - * @covers Zend\ServiceManager\ServiceManager::addInitializer + * @covers Laminas\ServiceManager\ServiceManager::addInitializer */ public function testAddInitializer() { @@ -138,16 +137,16 @@ public function testAddInitializer() } /** - * @covers Zend\ServiceManager\ServiceManager::addInitializer + * @covers Laminas\ServiceManager\ServiceManager::addInitializer */ public function testAddInitializerThrowsExceptionOnInvalidInitializer() { - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidArgumentException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidArgumentException'); $this->serviceManager->addInitializer(5); } /** - * @covers Zend\ServiceManager\ServiceManager::setService + * @covers Laminas\ServiceManager\ServiceManager::setService */ public function testSetService() { @@ -156,7 +155,7 @@ public function testSetService() } /** - * @covers Zend\ServiceManager\ServiceManager::setShared + * @covers Laminas\ServiceManager\ServiceManager::setShared */ public function testSetShared() { @@ -166,26 +165,26 @@ public function testSetShared() } /** - * @covers Zend\ServiceManager\ServiceManager::setShared + * @covers Laminas\ServiceManager\ServiceManager::setShared */ public function testSetSharedAbstractFactory() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); $ret = $this->serviceManager->setShared('foo', false); $this->assertSame($this->serviceManager, $ret); } /** - * @covers Zend\ServiceManager\ServiceManager::setShared + * @covers Laminas\ServiceManager\ServiceManager::setShared */ public function testSetSharedThrowsExceptionOnUnregisteredService() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $this->serviceManager->setShared('foo', true); } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGet() { @@ -194,7 +193,7 @@ public function testGet() } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetDoesNotThrowExceptionOnEmptyArray() { @@ -203,33 +202,33 @@ public function testGetDoesNotThrowExceptionOnEmptyArray() } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetThrowsExceptionOnUnknownService() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $this->assertEquals('bar', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetUsesIndivualSharedSettingWhenSetAndDeviatesFromShareByDefaultSetting() { $this->serviceManager->setAllowOverride(true); $this->serviceManager->setShareByDefault(false); - $this->serviceManager->setInvokableClass('foo', 'ZendTest\ServiceManager\TestAsset\Foo'); + $this->serviceManager->setInvokableClass('foo', 'LaminasTest\ServiceManager\TestAsset\Foo'); $this->serviceManager->setShared('foo', true); $this->assertSame($this->serviceManager->get('foo'), $this->serviceManager->get('foo')); $this->serviceManager->setShareByDefault(true); - $this->serviceManager->setInvokableClass('foo', 'ZendTest\ServiceManager\TestAsset\Foo'); + $this->serviceManager->setInvokableClass('foo', 'LaminasTest\ServiceManager\TestAsset\Foo'); $this->serviceManager->setShared('foo', false); $this->assertNotSame($this->serviceManager->get('foo'), $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetWithAlias() { @@ -239,17 +238,17 @@ public function testGetWithAlias() } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetAbstractFactoryWithAlias() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->serviceManager->setAlias('foo', 'ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->serviceManager->setAlias('foo', 'LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetWithScopedContainer() { @@ -292,72 +291,72 @@ public function testAllowsRetrievingFromPeeringContainerFirst() } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateWithInvokableClass() { - $this->serviceManager->setInvokableClass('foo', 'ZendTest\ServiceManager\TestAsset\Foo'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); + $this->serviceManager->setInvokableClass('foo', 'LaminasTest\ServiceManager\TestAsset\Foo'); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateWithFactoryInstance() { - $this->serviceManager->setFactory('foo', 'ZendTest\ServiceManager\TestAsset\FooFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); + $this->serviceManager->setFactory('foo', 'LaminasTest\ServiceManager\TestAsset\FooFactory'); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateWithCallableFactory() { $this->serviceManager->setFactory('foo', function () { return new TestAsset\Foo; }); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateWithAbstractFactory() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateWithMultipleAbstractFactories() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\BarAbstractFactory'); - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\BarAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Bar', $this->serviceManager->get('bar')); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Bar', $this->serviceManager->get('bar')); } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateTheSameServiceWithMultipleAbstractFactories() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooFakeAbstractFactory'); - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooFakeAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $this->serviceManager->get('foo')); } /** - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testCreateTheSameServiceWithMultipleAbstractFactoriesReversePriority() { - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooFakeAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooFakeAbstractFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\FooFake', $this->serviceManager->get('foo')); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\FooFake', $this->serviceManager->get('foo')); } public function testCreateWithInitializerObject() @@ -383,7 +382,7 @@ public function testHasAcceptsArrays() } /** - * @covers Zend\ServiceManager\ServiceManager::has + * @covers Laminas\ServiceManager\ServiceManager::has */ public function testHas() { @@ -393,7 +392,7 @@ public function testHas() } /** - * @covers Zend\ServiceManager\ServiceManager::setAlias + * @covers Laminas\ServiceManager\ServiceManager::setAlias */ public function testSetAlias() { @@ -403,37 +402,37 @@ public function testSetAlias() } /** - * @covers Zend\ServiceManager\ServiceManager::setAlias + * @covers Laminas\ServiceManager\ServiceManager::setAlias */ public function testSetAliasThrowsExceptionOnInvalidAliasName() { - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidServiceNameException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidServiceNameException'); $this->serviceManager->setAlias(5, 10); } /** - * @covers Zend\ServiceManager\ServiceManager::setAlias + * @covers Laminas\ServiceManager\ServiceManager::setAlias */ public function testSetAliasThrowsExceptionOnEmptyAliasName() { - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidServiceNameException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidServiceNameException'); $this->serviceManager->setAlias('', 'foo'); } /** - * @covers Zend\ServiceManager\ServiceManager::setAlias + * @covers Laminas\ServiceManager\ServiceManager::setAlias */ public function testSetAliasThrowsExceptionOnDuplicateAlias() { $this->serviceManager->setService('foo', 'bar'); $this->serviceManager->setAlias('baz', 'foo'); - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidServiceNameException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidServiceNameException'); $this->serviceManager->setAlias('baz', 'foo'); } /** - * @covers Zend\ServiceManager\ServiceManager::setAlias + * @covers Laminas\ServiceManager\ServiceManager::setAlias */ public function testSetAliasDoesNotThrowExceptionOnServiceNotFound() { @@ -441,28 +440,28 @@ public function testSetAliasDoesNotThrowExceptionOnServiceNotFound() } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testGetServiceThrowsExceptionOnAliasWithNoSetService() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $this->serviceManager->setAlias('foo', 'bar'); $this->serviceManager->get('foo'); } /** - * @cover Zend\ServiceManager\ServiceManager::get + * @cover Laminas\ServiceManager\ServiceManager::get */ public function testGetServiceThrowsExceptionOnMultipleAliasesWithNoSetService() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $this->serviceManager->setAlias('foo', 'bar'); $this->serviceManager->setAlias('baz', 'foo'); $this->serviceManager->get('foo'); } /** - * @covers Zend\ServiceManager\ServiceManager::hasAlias + * @covers Laminas\ServiceManager\ServiceManager::hasAlias */ public function testHasAlias() { @@ -474,7 +473,7 @@ public function testHasAlias() } /** - * @covers Zend\ServiceManager\ServiceManager::createScopedServiceManager + * @covers Laminas\ServiceManager\ServiceManager::createScopedServiceManager */ public function testCreateScopedServiceManager() { @@ -494,66 +493,66 @@ public function testConfigureWithInvokableClass() { $config = new Config(array( 'invokables' => array( - 'foo' => 'ZendTest\ServiceManager\TestAsset\Foo', + 'foo' => 'LaminasTest\ServiceManager\TestAsset\Foo', ), )); $serviceManager = new ServiceManager($config); $foo = $serviceManager->get('foo'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Foo', $foo); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Foo', $foo); } public function testPeeringService() { $di = new Di(); - $di->instanceManager()->setParameters('ZendTest\ServiceManager\TestAsset\Bar', array('foo' => array('a'))); + $di->instanceManager()->setParameters('LaminasTest\ServiceManager\TestAsset\Bar', array('foo' => array('a'))); $this->serviceManager->addAbstractFactory(new DiAbstractServiceFactory($di)); $sm = $this->serviceManager->createScopedServiceManager(ServiceManager::SCOPE_PARENT); $sm->setFactory('di', new DiFactory()); - $bar = $sm->get('ZendTest\ServiceManager\TestAsset\Bar', true); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Bar', $bar); + $bar = $sm->get('LaminasTest\ServiceManager\TestAsset\Bar', true); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Bar', $bar); } public function testDiAbstractServiceFactory() { - $di = $this->getMock('Zend\Di\Di'); + $di = $this->getMock('Laminas\Di\Di'); $factory = new DiAbstractServiceFactory($di); - $factory->instanceManager()->setConfig('ZendTest\ServiceManager\TestAsset\Bar', array('parameters' => array('foo' => array('a')))); + $factory->instanceManager()->setConfig('LaminasTest\ServiceManager\TestAsset\Bar', array('parameters' => array('foo' => array('a')))); $this->serviceManager->addAbstractFactory($factory); - $this->assertTrue($this->serviceManager->has('ZendTest\ServiceManager\TestAsset\Bar', true)); + $this->assertTrue($this->serviceManager->has('LaminasTest\ServiceManager\TestAsset\Bar', true)); - $bar = $this->serviceManager->get('ZendTest\ServiceManager\TestAsset\Bar', true); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Bar', $bar); + $bar = $this->serviceManager->get('LaminasTest\ServiceManager\TestAsset\Bar', true); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Bar', $bar); } public function testExceptionThrowingFactory() { - $this->serviceManager->setFactory('foo', 'ZendTest\ServiceManager\TestAsset\ExceptionThrowingFactory'); + $this->serviceManager->setFactory('foo', 'LaminasTest\ServiceManager\TestAsset\ExceptionThrowingFactory'); try { $this->serviceManager->get('foo'); $this->fail("No exception thrown"); } catch (Exception\ServiceNotCreatedException $e) { - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\FooException', $e->getPrevious()); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\FooException', $e->getPrevious()); } } /** - * @expectedException Zend\ServiceManager\Exception\ServiceNotFoundException + * @expectedException Laminas\ServiceManager\Exception\ServiceNotFoundException */ public function testCannotUseUnknownServiceNameForAbstractFactory() { $config = new Config(array( 'abstract_factories' => array( - 'ZendTest\ServiceManager\TestAsset\FooAbstractFactory', + 'LaminasTest\ServiceManager\TestAsset\FooAbstractFactory', ), )); $serviceManager = new ServiceManager($config); - $serviceManager->setFactory('foo', 'ZendTest\ServiceManager\TestAsset\FooFactory'); + $serviceManager->setFactory('foo', 'LaminasTest\ServiceManager\TestAsset\FooFactory'); $foo = $serviceManager->get('unknownObject'); } /** - * @expectedException Zend\ServiceManager\Exception\ServiceNotCreatedException + * @expectedException Laminas\ServiceManager\Exception\ServiceNotCreatedException */ public function testDoNotFallbackToAbstractFactory() { @@ -561,19 +560,19 @@ public function testDoNotFallbackToAbstractFactory() return new TestAsset\Bar(); }; $serviceManager = new ServiceManager(); - $serviceManager->setFactory('ZendTest\ServiceManager\TestAsset\Bar', $factory); + $serviceManager->setFactory('LaminasTest\ServiceManager\TestAsset\Bar', $factory); $di = new Di(); - $di->instanceManager()->setParameters('ZendTest\ServiceManager\TestAsset\Bar', array('foo' => array('a'))); + $di->instanceManager()->setParameters('LaminasTest\ServiceManager\TestAsset\Bar', array('foo' => array('a'))); $serviceManager->addAbstractFactory(new DiAbstractServiceFactory($di)); - $bar = $serviceManager->get('ZendTest\ServiceManager\TestAsset\Bar'); + $bar = $serviceManager->get('LaminasTest\ServiceManager\TestAsset\Bar'); } /** - * @expectedException Zend\ServiceManager\Exception\InvalidServiceNameException + * @expectedException Laminas\ServiceManager\Exception\InvalidServiceNameException */ public function testAssignAliasWithExistingServiceName() { - $this->serviceManager->setFactory('foo', 'ZendTest\ServiceManager\TestAsset\FooFactory'); + $this->serviceManager->setFactory('foo', 'LaminasTest\ServiceManager\TestAsset\FooFactory'); $this->serviceManager->setFactory('bar', function ($sm) { return new Bar(array('a')); }); @@ -583,8 +582,8 @@ public function testAssignAliasWithExistingServiceName() } /** - * @covers Zend\ServiceManager\ServiceManager::createFromAbstractFactory - * @covers Zend\ServiceManager\ServiceManager::has + * @covers Laminas\ServiceManager\ServiceManager::createFromAbstractFactory + * @covers Laminas\ServiceManager\ServiceManager::has */ public function testWillNotCreateCircularReferences() { @@ -616,7 +615,7 @@ public function testCallingANonExistingServiceFromAnAbstractServiceDoesNotMakeTh public function testMultipleAbstractFactoriesWithOneLookingForANonExistingServiceDuringCanCreate() { $abstractFactory = new TestAsset\TrollAbstractFactory; - $anotherAbstractFactory = $this->getMock('Zend\ServiceManager\AbstractFactoryInterface'); + $anotherAbstractFactory = $this->getMock('Laminas\ServiceManager\AbstractFactoryInterface'); $anotherAbstractFactory ->expects($this->exactly(2)) ->method('canCreateServiceWithName') @@ -668,7 +667,7 @@ public function testWaitingAbstractFactoryNestedContextCounterWhenThrowException $this->assertEquals(-1, $contextCounter->getValue($this->serviceManager)); try { $this->serviceManager->get('SomethingThatCanBeCreated'); - $this->fail('serviceManager shoud throw Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->fail('serviceManager shoud throw Laminas\ServiceManager\Exception\ServiceNotFoundException'); } catch (\Exception $e) { if (stripos(get_class($e), 'PHPUnit') !== false) { throw $e; @@ -680,7 +679,7 @@ public function testWaitingAbstractFactoryNestedContextCounterWhenThrowException $abstractFactory->throwExceptionWhenCreate = true; try { $this->serviceManager->get('SomethingThatCanBeCreated'); - $this->fail('serviceManager shoud throw Zend\ServiceManager\Exception\ServiceNotCreatedException'); + $this->fail('serviceManager shoud throw Laminas\ServiceManager\Exception\ServiceNotCreatedException'); } catch (\Exception $e) { if (stripos(get_class($e), 'PHPUnit') !== false) { throw $e; @@ -691,13 +690,13 @@ public function testWaitingAbstractFactoryNestedContextCounterWhenThrowException public function testShouldAllowAddingInitializersAsClassNames() { - $result = $this->serviceManager->addInitializer('ZendTest\ServiceManager\TestAsset\FooInitializer'); + $result = $this->serviceManager->addInitializer('LaminasTest\ServiceManager\TestAsset\FooInitializer'); $this->assertSame($this->serviceManager, $result); } public function testShouldRaiseExceptionIfInitializerClassIsNotAnInitializerInterfaceImplementation() { - $this->setExpectedException('Zend\ServiceManager\Exception\InvalidArgumentException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\InvalidArgumentException'); $result = $this->serviceManager->addInitializer(get_class($this)); } @@ -705,12 +704,12 @@ public function testGetGlobIteratorServiceWorksProperly() { $config = new Config(array( 'invokables' => array( - 'foo' => 'ZendTest\ServiceManager\TestAsset\GlobIteratorService', + 'foo' => 'LaminasTest\ServiceManager\TestAsset\GlobIteratorService', ), )); $serviceManager = new ServiceManager($config); $foo = $serviceManager->get('foo'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\GlobIteratorService', $foo); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\GlobIteratorService', $foo); } public function duplicateService() @@ -759,7 +758,7 @@ public function testWithAllowOverrideOnRegisteringAServiceDuplicatingAnExistingA } /** - * @covers Zend\ServiceManager\ServiceManager::canonicalizeName + * @covers Laminas\ServiceManager\ServiceManager::canonicalizeName */ public function testCanonicalizeName() { @@ -772,7 +771,7 @@ public function testCanonicalizeName() } /** - * @covers Zend\ServiceManager\ServiceManager::canCreateFromAbstractFactory + * @covers Laminas\ServiceManager\ServiceManager::canCreateFromAbstractFactory */ public function testWanCreateFromAbstractFactoryWillNotInstantiateAbstractFactoryOnce() { @@ -786,18 +785,18 @@ public function testWanCreateFromAbstractFactoryWillNotInstantiateAbstractFactor } /** - * @covers Zend\ServiceManager\ServiceManager::canCreateFromAbstractFactory - * @covers Zend\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::canCreateFromAbstractFactory + * @covers Laminas\ServiceManager\ServiceManager::create */ public function testAbstractFactoryNotUsedIfNotAbleToCreate() { $service = new \stdClass; - $af1 = $this->getMock('Zend\ServiceManager\AbstractFactoryInterface'); + $af1 = $this->getMock('Laminas\ServiceManager\AbstractFactoryInterface'); $af1->expects($this->any())->method('canCreateServiceWithName')->will($this->returnValue(true)); $af1->expects($this->any())->method('createServiceWithName')->will($this->returnValue($service)); - $af2 = $this->getMock('Zend\ServiceManager\AbstractFactoryInterface'); + $af2 = $this->getMock('Laminas\ServiceManager\AbstractFactoryInterface'); $af2->expects($this->any())->method('canCreateServiceWithName')->will($this->returnValue(false)); $af2->expects($this->never())->method('createServiceWithName'); @@ -808,9 +807,9 @@ public function testAbstractFactoryNotUsedIfNotAbleToCreate() } /** - * @covers Zend\ServiceManager\ServiceManager::setAlias - * @covers Zend\ServiceManager\ServiceManager::get - * @covers Zend\ServiceManager\ServiceManager::retrieveFromPeeringManager + * @covers Laminas\ServiceManager\ServiceManager::setAlias + * @covers Laminas\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::retrieveFromPeeringManager */ public function testCanGetAliasedServicesFromPeeringServiceManagers() { @@ -826,24 +825,24 @@ public function testCanGetAliasedServicesFromPeeringServiceManagers() } /** - * @covers Zend\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::get */ public function testDuplicateNewInstanceMultipleAbstractFactories() { $this->serviceManager->setAllowOverride(true); $this->serviceManager->setShareByDefault(false); - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\BarAbstractFactory'); - $this->serviceManager->addAbstractFactory('ZendTest\ServiceManager\TestAsset\FooAbstractFactory'); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Bar', $this->serviceManager->get('bar')); - $this->assertInstanceOf('ZendTest\ServiceManager\TestAsset\Bar', $this->serviceManager->get('bar')); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\BarAbstractFactory'); + $this->serviceManager->addAbstractFactory('LaminasTest\ServiceManager\TestAsset\FooAbstractFactory'); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Bar', $this->serviceManager->get('bar')); + $this->assertInstanceOf('LaminasTest\ServiceManager\TestAsset\Bar', $this->serviceManager->get('bar')); } /** - * @covers Zend\ServiceManager\ServiceManager::setService - * @covers Zend\ServiceManager\ServiceManager::get - * @covers Zend\ServiceManager\ServiceManager::retrieveFromPeeringManagerFirst - * @covers Zend\ServiceManager\ServiceManager::setRetrieveFromPeeringManagerFirst - * @covers Zend\ServiceManager\ServiceManager::addPeeringServiceManager + * @covers Laminas\ServiceManager\ServiceManager::setService + * @covers Laminas\ServiceManager\ServiceManager::get + * @covers Laminas\ServiceManager\ServiceManager::retrieveFromPeeringManagerFirst + * @covers Laminas\ServiceManager\ServiceManager::setRetrieveFromPeeringManagerFirst + * @covers Laminas\ServiceManager\ServiceManager::addPeeringServiceManager */ public function testRetrieveServiceFromPeeringServiceManagerIfretrieveFromPeeringManagerFirstSetToTrueAndServiceNamesAreSame() { @@ -871,14 +870,14 @@ public function testRetrieveServiceFromPeeringServiceManagerIfretrieveFromPeerin } /** - * @covers Zend\ServiceManager\ServiceManager::create - * @covers Zend\ServiceManager\ServiceManager::createDelegatorFromFactory - * @covers Zend\ServiceManager\ServiceManager::createDelegatorCallback - * @covers Zend\ServiceManager\ServiceManager::addDelegator + * @covers Laminas\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorFromFactory + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorCallback + * @covers Laminas\ServiceManager\ServiceManager::addDelegator */ public function testUsesDelegatorWhenAvailable() { - $delegator = $this->getMock('Zend\\ServiceManager\\DelegatorFactoryInterface'); + $delegator = $this->getMock('Laminas\\ServiceManager\\DelegatorFactoryInterface'); $this->serviceManager->setService('foo-delegator', $delegator); $this->serviceManager->addDelegator('foo-service', 'foo-delegator'); @@ -907,10 +906,10 @@ public function testUsesDelegatorWhenAvailable() } /** - * @covers Zend\ServiceManager\ServiceManager::create - * @covers Zend\ServiceManager\ServiceManager::createDelegatorFromFactory - * @covers Zend\ServiceManager\ServiceManager::createDelegatorCallback - * @covers Zend\ServiceManager\ServiceManager::addDelegator + * @covers Laminas\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorFromFactory + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorCallback + * @covers Laminas\ServiceManager\ServiceManager::addDelegator */ public function testUsesMultipleDelegates() { @@ -931,11 +930,11 @@ public function testUsesMultipleDelegates() } /** - * @covers Zend\ServiceManager\ServiceManager::resolveAlias + * @covers Laminas\ServiceManager\ServiceManager::resolveAlias */ public function testSetCircularAliasReferenceThrowsException() { - $this->setExpectedException('Zend\ServiceManager\Exception\CircularReferenceException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\CircularReferenceException'); // Only affects service managers that allow overwriting definitions $this->serviceManager->setAllowOverride(true); @@ -949,11 +948,11 @@ public function testSetCircularAliasReferenceThrowsException() } /** - * @covers Zend\ServiceManager\ServiceManager::checkForCircularAliasReference + * @covers Laminas\ServiceManager\ServiceManager::checkForCircularAliasReference */ public function testResolveCircularAliasReferenceThrowsException() { - $this->setExpectedException('Zend\ServiceManager\Exception\CircularReferenceException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\CircularReferenceException'); // simulate an inconsistent state of $servicemanager->aliases as it could be // caused by derived classes @@ -973,11 +972,11 @@ public function testResolveCircularAliasReferenceThrowsException() } /** - * @covers Zend\ServiceManager\ServiceManager::createDelegatorFromFactory + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorFromFactory */ public function testDelegatorFactoryWhenNotRegisteredAsService() { - $delegator = $this->getMock('Zend\\ServiceManager\\DelegatorFactoryInterface'); + $delegator = $this->getMock('Laminas\\ServiceManager\\DelegatorFactoryInterface'); $this->serviceManager->addDelegator('foo-service', $delegator); $this->serviceManager->setInvokableClass('foo-service', 'stdClass'); @@ -1005,10 +1004,10 @@ public function testDelegatorFactoryWhenNotRegisteredAsService() } /** - * @covers Zend\ServiceManager\ServiceManager::create - * @covers Zend\ServiceManager\ServiceManager::createDelegatorFromFactory - * @covers Zend\ServiceManager\ServiceManager::createDelegatorCallback - * @covers Zend\ServiceManager\ServiceManager::addDelegator + * @covers Laminas\ServiceManager\ServiceManager::create + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorFromFactory + * @covers Laminas\ServiceManager\ServiceManager::createDelegatorCallback + * @covers Laminas\ServiceManager\ServiceManager::addDelegator */ public function testMultipleDelegatorFactoriesWhenNotRegisteredAsServices() { @@ -1080,7 +1079,7 @@ public function testDelegatorFromCallback() */ public function testAbstractFactoriesCanReturnAnyTypeButNull($service) { - $abstractFactory = $this->getMock('Zend\ServiceManager\AbstractFactoryInterface'); + $abstractFactory = $this->getMock('Laminas\ServiceManager\AbstractFactoryInterface'); $abstractFactory ->expects($this->any()) ->method('canCreateServiceWithName') @@ -1100,7 +1099,7 @@ public function testAbstractFactoriesCanReturnAnyTypeButNull($service) $this->serviceManager->get('something'); $this->fail('ServiceManager::get() successfully returned null'); } catch (\Exception $e) { - $this->assertInstanceOf('Zend\ServiceManager\Exception\ServiceNotCreatedException', $e); + $this->assertInstanceOf('Laminas\ServiceManager\Exception\ServiceNotCreatedException', $e); } } else { $this->assertSame($service, $this->serviceManager->get('something')); @@ -1123,7 +1122,7 @@ public function testFactoriesCanReturnAnyTypeButNull($service) $this->serviceManager->get('something'); $this->fail('ServiceManager::get() successfully returned null'); } catch (\Exception $e) { - $this->assertInstanceOf('Zend\ServiceManager\Exception\ServiceNotCreatedException', $e); + $this->assertInstanceOf('Laminas\ServiceManager\Exception\ServiceNotCreatedException', $e); } } else { $this->assertSame($service, $this->serviceManager->get('something')); @@ -1143,7 +1142,7 @@ public function testServicesCanBeOfAnyTypeButNull($service) $this->serviceManager->get('something'); $this->fail('ServiceManager::get() successfully returned null'); } catch (\Exception $e) { - $this->assertInstanceOf('Zend\ServiceManager\Exception\ServiceNotFoundException', $e); + $this->assertInstanceOf('Laminas\ServiceManager\Exception\ServiceNotFoundException', $e); } } else { $this->assertSame($service, $this->serviceManager->get('something')); @@ -1166,11 +1165,11 @@ public function getServiceOfVariousTypes() } /** - * @group ZF2-4377 + * @group Laminas-4377 */ public function testServiceManagerRespectsSharedFlagWhenRetrievingFromPeeredServiceManager() { - $this->serviceManager->setInvokableClass('foo', 'ZendTest\ServiceManager\TestAsset\Foo'); + $this->serviceManager->setInvokableClass('foo', 'LaminasTest\ServiceManager\TestAsset\Foo'); $this->serviceManager->setShared('foo', false); $childManager = new ServiceManager(new Config()); @@ -1181,17 +1180,17 @@ public function testServiceManagerRespectsSharedFlagWhenRetrievingFromPeeredServ } /** - * @group ZF2-4377 + * @group Laminas-4377 */ public function testIsSharedThrowsExceptionWhenPassedNameWhichDoesNotExistAnywhere() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $this->serviceManager->isShared('foobarbazbat'); } public function testPeeringServiceManagersInBothDirectionsDontRunIntoInfiniteLoop() { - $this->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $this->setExpectedException('Laminas\ServiceManager\Exception\ServiceNotFoundException'); $peeredServiceManager = $this->serviceManager->createScopedServiceManager(ServiceManager::SCOPE_CHILD); $peeredServiceManager->addPeeringServiceManager($this->serviceManager); $this->serviceManager->get('foobarbazbat'); diff --git a/test/TestAsset/AbstractFactoryWithMutableCreationOptions.php b/test/TestAsset/AbstractFactoryWithMutableCreationOptions.php index ac6b555c..6f8a2729 100644 --- a/test/TestAsset/AbstractFactoryWithMutableCreationOptions.php +++ b/test/TestAsset/AbstractFactoryWithMutableCreationOptions.php @@ -1,18 +1,17 @@