Skip to content

Commit 427d11b

Browse files
committed
fixed obsolete getMock() usage
1 parent 88fea59 commit 427d11b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Tests/ApplicationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ public function testFindAlternativeNamespace()
454454

455455
public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
456456
{
457-
$application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces'));
457+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getNamespaces'))->getMock();
458458
$application->expects($this->once())
459459
->method('getNamespaces')
460460
->will($this->returnValue(array('foo:sublong', 'bar:sub')));
@@ -701,7 +701,7 @@ public function testRunReturnsIntegerExitCode()
701701
{
702702
$exception = new \Exception('', 4);
703703

704-
$application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
704+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
705705
$application->setAutoExit(false);
706706
$application->expects($this->once())
707707
->method('doRun')
@@ -716,7 +716,7 @@ public function testRunReturnsExitCodeOneForExceptionCodeZero()
716716
{
717717
$exception = new \Exception('', 0);
718718

719-
$application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
719+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
720720
$application->setAutoExit(false);
721721
$application->expects($this->once())
722722
->method('doRun')

Tests/Helper/AbstractQuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class AbstractQuestionHelperTest extends \PHPUnit_Framework_TestCase
1717
{
1818
protected function createStreamableInputInterfaceMock($stream = null, $interactive = true)
1919
{
20-
$mock = $this->getMock(StreamableInputInterface::class);
20+
$mock = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
2121
$mock->expects($this->any())
2222
->method('isInteractive')
2323
->will($this->returnValue($interactive));

Tests/Helper/QuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ public function testLegacyChoiceOutputFormattingQuestionForUtf8Keys()
730730
' [<info>żółw </info>] bar',
731731
' [<info>łabądź</info>] baz',
732732
);
733-
$output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
733+
$output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock();
734734
$output->method('getFormatter')->willReturn(new OutputFormatter());
735735

736736
$dialog = new QuestionHelper();

0 commit comments

Comments
 (0)