This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 17
17
use Zend \ServiceManager \Exception \ContainerModificationsNotAllowedException ;
18
18
use Zend \ServiceManager \Exception \InvalidArgumentException ;
19
19
use Zend \ServiceManager \Exception \ServiceNotCreatedException ;
20
+ use Zend \ServiceManager \Exception \ServiceNotFoundException ;
20
21
use Zend \ServiceManager \Factory \FactoryInterface ;
21
22
use Zend \ServiceManager \Initializer \InitializerInterface ;
22
23
use Zend \ServiceManager \ServiceLocatorInterface ;
@@ -783,4 +784,21 @@ public function testCanRetrieveParentContainerViaGetServiceLocatorWithDeprecatio
783
784
$ this ->assertSame ($ this ->creationContext , $ container ->getServiceLocator ());
784
785
restore_error_handler ();
785
786
}
787
+
788
+ /**
789
+ * @group zendframework/zend-servicemanager#83
790
+ */
791
+ public function testCrashesOnCyclicAliases ()
792
+ {
793
+ $ serviceManager = $ this ->createContainer ([
794
+ 'aliases ' => [
795
+ 'a ' => 'b ' ,
796
+ 'b ' => 'a ' ,
797
+ ],
798
+ ]);
799
+
800
+ $ this ->setExpectedException (ServiceNotFoundException::class);
801
+
802
+ $ serviceManager ->get ('b ' );
803
+ }
786
804
}
Original file line number Diff line number Diff line change @@ -237,18 +237,4 @@ public function testAliasToAnExplicitServiceShouldWork()
237
237
238
238
$ this ->assertSame ($ service , $ alias );
239
239
}
240
-
241
- public function testCrashesOnCyclicAliases ()
242
- {
243
- $ serviceManager = new ServiceManager ([
244
- 'aliases ' => [
245
- 'a ' => 'b ' ,
246
- 'b ' => 'a ' ,
247
- ],
248
- ]);
249
-
250
- $ this ->setExpectedException (ServiceNotFoundException::class);
251
-
252
- $ serviceManager ->get ('b ' );
253
- }
254
240
}
You can’t perform that action at this time.
0 commit comments