17
17
use Symfony \Component \DependencyInjection \Compiler \CheckCircularReferencesPass ;
18
18
use Symfony \Component \DependencyInjection \Compiler \Compiler ;
19
19
use Symfony \Component \DependencyInjection \ContainerBuilder ;
20
+ use Symfony \Component \DependencyInjection \Exception \ServiceCircularReferenceException ;
20
21
use Symfony \Component \DependencyInjection \Reference ;
21
22
22
23
class CheckCircularReferencesPassTest extends TestCase
23
24
{
24
25
public function testProcess ()
25
26
{
26
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ ServiceCircularReferenceException::class);
27
+ $ this ->expectException (ServiceCircularReferenceException::class);
27
28
$ container = new ContainerBuilder ();
28
29
$ container ->register ('a ' )->addArgument (new Reference ('b ' ));
29
30
$ container ->register ('b ' )->addArgument (new Reference ('a ' ));
@@ -33,7 +34,7 @@ public function testProcess()
33
34
34
35
public function testProcessWithAliases ()
35
36
{
36
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ ServiceCircularReferenceException::class);
37
+ $ this ->expectException (ServiceCircularReferenceException::class);
37
38
$ container = new ContainerBuilder ();
38
39
$ container ->register ('a ' )->addArgument (new Reference ('b ' ));
39
40
$ container ->setAlias ('b ' , 'c ' );
@@ -44,7 +45,7 @@ public function testProcessWithAliases()
44
45
45
46
public function testProcessWithFactory ()
46
47
{
47
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ ServiceCircularReferenceException::class);
48
+ $ this ->expectException (ServiceCircularReferenceException::class);
48
49
$ container = new ContainerBuilder ();
49
50
50
51
$ container
@@ -60,7 +61,7 @@ public function testProcessWithFactory()
60
61
61
62
public function testProcessDetectsIndirectCircularReference ()
62
63
{
63
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ ServiceCircularReferenceException::class);
64
+ $ this ->expectException (ServiceCircularReferenceException::class);
64
65
$ container = new ContainerBuilder ();
65
66
$ container ->register ('a ' )->addArgument (new Reference ('b ' ));
66
67
$ container ->register ('b ' )->addArgument (new Reference ('c ' ));
@@ -71,7 +72,7 @@ public function testProcessDetectsIndirectCircularReference()
71
72
72
73
public function testProcessDetectsIndirectCircularReferenceWithFactory ()
73
74
{
74
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ ServiceCircularReferenceException::class);
75
+ $ this ->expectException (ServiceCircularReferenceException::class);
75
76
$ container = new ContainerBuilder ();
76
77
77
78
$ container ->register ('a ' )->addArgument (new Reference ('b ' ));
@@ -87,7 +88,7 @@ public function testProcessDetectsIndirectCircularReferenceWithFactory()
87
88
88
89
public function testDeepCircularReference ()
89
90
{
90
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ ServiceCircularReferenceException::class);
91
+ $ this ->expectException (ServiceCircularReferenceException::class);
91
92
$ container = new ContainerBuilder ();
92
93
$ container ->register ('a ' )->addArgument (new Reference ('b ' ));
93
94
$ container ->register ('b ' )->addArgument (new Reference ('c ' ));
0 commit comments