Skip to content

Commit bbfc3e4

Browse files
[Tests] Replace setMethods() by onlyMethods() and addMethods()
1 parent c77433d commit bbfc3e4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tests/ApplicationTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ public function testFindAlternativesOutput()
716716

717717
public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
718718
{
719-
$application = $this->getMockBuilder(Application::class)->setMethods(['getNamespaces'])->getMock();
719+
$application = $this->getMockBuilder(Application::class)->onlyMethods(['getNamespaces'])->getMock();
720720
$application->expects($this->once())
721721
->method('getNamespaces')
722722
->willReturn(['foo:sublong', 'bar:sub']);
@@ -876,7 +876,7 @@ public function testRenderExceptionEscapesLines()
876876

877877
public function testRenderExceptionLineBreaks()
878878
{
879-
$application = $this->getMockBuilder(Application::class)->setMethods(['getTerminalWidth'])->getMock();
879+
$application = $this->getMockBuilder(Application::class)->addMethods(['getTerminalWidth'])->getMock();
880880
$application->setAutoExit(false);
881881
$application->expects($this->any())
882882
->method('getTerminalWidth')
@@ -1103,7 +1103,7 @@ public function testRunReturnsIntegerExitCode()
11031103
{
11041104
$exception = new \Exception('', 4);
11051105

1106-
$application = $this->getMockBuilder(Application::class)->setMethods(['doRun'])->getMock();
1106+
$application = $this->getMockBuilder(Application::class)->onlyMethods(['doRun'])->getMock();
11071107
$application->setAutoExit(false);
11081108
$application->expects($this->once())
11091109
->method('doRun')
@@ -1142,7 +1142,7 @@ public function testRunReturnsExitCodeOneForExceptionCodeZero()
11421142
{
11431143
$exception = new \Exception('', 0);
11441144

1145-
$application = $this->getMockBuilder(Application::class)->setMethods(['doRun'])->getMock();
1145+
$application = $this->getMockBuilder(Application::class)->onlyMethods(['doRun'])->getMock();
11461146
$application->setAutoExit(false);
11471147
$application->expects($this->once())
11481148
->method('doRun')
@@ -1185,7 +1185,7 @@ public function testRunReturnsExitCodeOneForNegativeExceptionCode($exceptionCode
11851185
{
11861186
$exception = new \Exception('', $exceptionCode);
11871187

1188-
$application = $this->getMockBuilder(Application::class)->setMethods(['doRun'])->getMock();
1188+
$application = $this->getMockBuilder(Application::class)->onlyMethods(['doRun'])->getMock();
11891189
$application->setAutoExit(false);
11901190
$application->expects($this->once())
11911191
->method('doRun')

0 commit comments

Comments
 (0)