@@ -31,13 +31,13 @@ public function testThrowsException()
3131 $ autowireException = new AutowiringFailedException ('foo_service_id ' , 'An autowiring exception message ' );
3232 $ autowirePass ->expects ($ this ->any ())
3333 ->method ('getAutowiringExceptions ' )
34- ->will ( $ this -> returnValue ( [$ autowireException ]) );
34+ ->willReturn ( [$ autowireException ]);
3535
3636 $ inlinePass = $ this ->getMockBuilder (InlineServiceDefinitionsPass::class)
3737 ->getMock ();
3838 $ inlinePass ->expects ($ this ->any ())
3939 ->method ('getInlinedServiceIds ' )
40- ->will ( $ this -> returnValue ([]) );
40+ ->willReturn ([] );
4141
4242 $ container = new ContainerBuilder ();
4343 $ container ->register ('foo_service_id ' );
@@ -60,18 +60,18 @@ public function testThrowExceptionIfServiceInlined()
6060 $ autowireException = new AutowiringFailedException ('a_service ' , 'An autowiring exception message ' );
6161 $ autowirePass ->expects ($ this ->any ())
6262 ->method ('getAutowiringExceptions ' )
63- ->will ( $ this -> returnValue ( [$ autowireException ]) );
63+ ->willReturn ( [$ autowireException ]);
6464
6565 $ inlinePass = $ this ->getMockBuilder (InlineServiceDefinitionsPass::class)
6666 ->getMock ();
6767 $ inlinePass ->expects ($ this ->any ())
6868 ->method ('getInlinedServiceIds ' )
69- ->will ( $ this -> returnValue ([
69+ ->willReturn ([
7070 // a_service inlined into b_service
7171 'a_service ' => ['b_service ' ],
7272 // b_service inlined into c_service
7373 'b_service ' => ['c_service ' ],
74- ])) ;
74+ ]);
7575
7676 $ container = new ContainerBuilder ();
7777 // ONLY register c_service in the final container
@@ -95,18 +95,18 @@ public function testDoNotThrowExceptionIfServiceInlinedButRemoved()
9595 $ autowireException = new AutowiringFailedException ('a_service ' , 'An autowiring exception message ' );
9696 $ autowirePass ->expects ($ this ->any ())
9797 ->method ('getAutowiringExceptions ' )
98- ->will ( $ this -> returnValue ( [$ autowireException ]) );
98+ ->willReturn ( [$ autowireException ]);
9999
100100 $ inlinePass = $ this ->getMockBuilder (InlineServiceDefinitionsPass::class)
101101 ->getMock ();
102102 $ inlinePass ->expects ($ this ->any ())
103103 ->method ('getInlinedServiceIds ' )
104- ->will ( $ this -> returnValue ([
104+ ->willReturn ([
105105 // a_service inlined into b_service
106106 'a_service ' => ['b_service ' ],
107107 // b_service inlined into c_service
108108 'b_service ' => ['c_service ' ],
109- ])) ;
109+ ]);
110110
111111 // do NOT register c_service in the container
112112 $ container = new ContainerBuilder ();
@@ -126,13 +126,13 @@ public function testNoExceptionIfServiceRemoved()
126126 $ autowireException = new AutowiringFailedException ('non_existent_service ' );
127127 $ autowirePass ->expects ($ this ->any ())
128128 ->method ('getAutowiringExceptions ' )
129- ->will ( $ this -> returnValue ( [$ autowireException ]) );
129+ ->willReturn ( [$ autowireException ]);
130130
131131 $ inlinePass = $ this ->getMockBuilder (InlineServiceDefinitionsPass::class)
132132 ->getMock ();
133133 $ inlinePass ->expects ($ this ->any ())
134134 ->method ('getInlinedServiceIds ' )
135- ->will ( $ this -> returnValue ([]) );
135+ ->willReturn ([] );
136136
137137 $ container = new ContainerBuilder ();
138138
0 commit comments