Skip to content

Commit 5de015a

Browse files
committed
Use willReturn() instead of will(returnValue()).
1 parent 8e1d1e4 commit 5de015a

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

Tests/ApplicationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
660660
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getNamespaces'])->getMock();
661661
$application->expects($this->once())
662662
->method('getNamespaces')
663-
->will($this->returnValue(['foo:sublong', 'bar:sub']));
663+
->willReturn(['foo:sublong', 'bar:sub']);
664664

665665
$this->assertEquals('foo:sublong', $application->findNamespace('f:sub'));
666666
}
@@ -804,7 +804,7 @@ public function testRenderExceptionLineBreaks()
804804
$application->setAutoExit(false);
805805
$application->expects($this->any())
806806
->method('getTerminalWidth')
807-
->will($this->returnValue(120));
807+
->willReturn(120);
808808
$application->register('foo')->setCode(function () {
809809
throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n");
810810
});

Tests/Command/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function testRunReturnsIntegerExitCode()
321321
$command = $this->getMockBuilder('TestCommand')->setMethods(['execute'])->getMock();
322322
$command->expects($this->once())
323323
->method('execute')
324-
->will($this->returnValue('2.3'));
324+
->willReturn('2.3');
325325
$exitCode = $command->run(new StringInput(''), new NullOutput());
326326
$this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)');
327327
}

Tests/Helper/AbstractQuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protected function createStreamableInputInterfaceMock($stream = null, $interacti
2121
$mock = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
2222
$mock->expects($this->any())
2323
->method('isInteractive')
24-
->will($this->returnValue($interactive));
24+
->willReturn($interactive);
2525

2626
if ($stream) {
2727
$mock->expects($this->any())

Tests/Helper/HelperSetTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private function getGenericMockHelper($name, HelperSet $helperset = null)
114114
$mock_helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\HelperInterface')->getMock();
115115
$mock_helper->expects($this->any())
116116
->method('getName')
117-
->will($this->returnValue($name));
117+
->willReturn($name);
118118

119119
if ($helperset) {
120120
$mock_helper->expects($this->any())

Tests/Helper/QuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ protected function createInputInterfaceMock($interactive = true)
10681068
$mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
10691069
$mock->expects($this->any())
10701070
->method('isInteractive')
1071-
->will($this->returnValue($interactive));
1071+
->willReturn($interactive);
10721072

10731073
return $mock;
10741074
}

Tests/Helper/SymfonyQuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function createInputInterfaceMock($interactive = true)
154154
$mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
155155
$mock->expects($this->any())
156156
->method('isInteractive')
157-
->will($this->returnValue($interactive));
157+
->willReturn($interactive);
158158

159159
return $mock;
160160
}

Tests/Logger/ConsoleLoggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function testObjectCastToString()
166166
} else {
167167
$dummy = $this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']);
168168
}
169-
$dummy->method('__toString')->will($this->returnValue('DUMMY'));
169+
$dummy->method('__toString')->willReturn('DUMMY');
170170

171171
$this->getLogger()->warning($dummy);
172172

0 commit comments

Comments
 (0)