24
24
class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase
25
25
{
26
26
/**
27
- * @expectedException \RuntimeException
27
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
28
28
*/
29
29
public function testProcess ()
30
30
{
@@ -36,7 +36,7 @@ public function testProcess()
36
36
}
37
37
38
38
/**
39
- * @expectedException \RuntimeException
39
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
40
40
*/
41
41
public function testProcessWithAliases ()
42
42
{
@@ -49,7 +49,7 @@ public function testProcessWithAliases()
49
49
}
50
50
51
51
/**
52
- * @expectedException \RuntimeException
52
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
53
53
*/
54
54
public function testProcessDetectsIndirectCircularReference ()
55
55
{
@@ -61,6 +61,19 @@ public function testProcessDetectsIndirectCircularReference()
61
61
$ this ->process ($ container );
62
62
}
63
63
64
+ /**
65
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
66
+ */
67
+ public function testDeepCircularReference ()
68
+ {
69
+ $ container = new ContainerBuilder ();
70
+ $ container ->register ('a ' )->addArgument (new Reference ('b ' ));
71
+ $ container ->register ('b ' )->addArgument (new Reference ('c ' ));
72
+ $ container ->register ('c ' )->addArgument (new Reference ('b ' ));
73
+
74
+ $ this ->process ($ container );
75
+ }
76
+
64
77
public function testProcessIgnoresMethodCalls ()
65
78
{
66
79
$ container = new ContainerBuilder ();
0 commit comments