Skip to content

Commit ed05f00

Browse files
Merge branch '4.2' into 4.3
* 4.2: Use willReturn() instead of will(returnValue()).
2 parents 707b619 + 5b9594b commit ed05f00

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
@@ -709,7 +709,7 @@ public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
709709
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getNamespaces'])->getMock();
710710
$application->expects($this->once())
711711
->method('getNamespaces')
712-
->will($this->returnValue(['foo:sublong', 'bar:sub']));
712+
->willReturn(['foo:sublong', 'bar:sub']);
713713

714714
$this->assertEquals('foo:sublong', $application->findNamespace('f:sub'));
715715
}
@@ -853,7 +853,7 @@ public function testRenderExceptionLineBreaks()
853853
$application->setAutoExit(false);
854854
$application->expects($this->any())
855855
->method('getTerminalWidth')
856-
->will($this->returnValue(120));
856+
->willReturn(120);
857857
$application->register('foo')->setCode(function () {
858858
throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n");
859859
});

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
@@ -760,7 +760,7 @@ protected function createInputInterfaceMock($interactive = true)
760760
$mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
761761
$mock->expects($this->any())
762762
->method('isInteractive')
763-
->will($this->returnValue($interactive));
763+
->willReturn($interactive);
764764

765765
return $mock;
766766
}

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)