@@ -733,7 +733,7 @@ public function testFindAlternativesOutput()
733733
734734 public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces ()
735735 {
736- $ application = $ this ->getMockBuilder (Application::class)->setMethods (['getNamespaces ' ])->getMock ();
736+ $ application = $ this ->getMockBuilder (Application::class)->onlyMethods (['getNamespaces ' ])->getMock ();
737737 $ application ->expects ($ this ->once ())
738738 ->method ('getNamespaces ' )
739739 ->willReturn (['foo:sublong ' , 'bar:sub ' ]);
@@ -893,7 +893,7 @@ public function testRenderExceptionEscapesLines()
893893
894894 public function testRenderExceptionLineBreaks ()
895895 {
896- $ application = $ this ->getMockBuilder (Application::class)->setMethods (['getTerminalWidth ' ])->getMock ();
896+ $ application = $ this ->getMockBuilder (Application::class)->addMethods (['getTerminalWidth ' ])->getMock ();
897897 $ application ->setAutoExit (false );
898898 $ application ->expects ($ this ->any ())
899899 ->method ('getTerminalWidth ' )
@@ -1120,7 +1120,7 @@ public function testRunReturnsIntegerExitCode()
11201120 {
11211121 $ exception = new \Exception ('' , 4 );
11221122
1123- $ application = $ this ->getMockBuilder (Application::class)->setMethods (['doRun ' ])->getMock ();
1123+ $ application = $ this ->getMockBuilder (Application::class)->onlyMethods (['doRun ' ])->getMock ();
11241124 $ application ->setAutoExit (false );
11251125 $ application ->expects ($ this ->once ())
11261126 ->method ('doRun ' )
@@ -1159,7 +1159,7 @@ public function testRunReturnsExitCodeOneForExceptionCodeZero()
11591159 {
11601160 $ exception = new \Exception ('' , 0 );
11611161
1162- $ application = $ this ->getMockBuilder (Application::class)->setMethods (['doRun ' ])->getMock ();
1162+ $ application = $ this ->getMockBuilder (Application::class)->onlyMethods (['doRun ' ])->getMock ();
11631163 $ application ->setAutoExit (false );
11641164 $ application ->expects ($ this ->once ())
11651165 ->method ('doRun ' )
@@ -1202,7 +1202,7 @@ public function testRunReturnsExitCodeOneForNegativeExceptionCode($exceptionCode
12021202 {
12031203 $ exception = new \Exception ('' , $ exceptionCode );
12041204
1205- $ application = $ this ->getMockBuilder (Application::class)->setMethods (['doRun ' ])->getMock ();
1205+ $ application = $ this ->getMockBuilder (Application::class)->onlyMethods (['doRun ' ])->getMock ();
12061206 $ application ->setAutoExit (false );
12071207 $ application ->expects ($ this ->once ())
12081208 ->method ('doRun ' )
0 commit comments