Skip to content

Commit 84a1ec3

Browse files
committed
fixed obsolete getMock() usage
1 parent 3372a73 commit 84a1ec3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Tests/ApplicationTest.php

Lines changed: 8 additions & 8 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')));
@@ -476,7 +476,7 @@ public function testFindWithDoubleColonInNameThrowsException()
476476

477477
public function testSetCatchExceptions()
478478
{
479-
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
479+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
480480
$application->setAutoExit(false);
481481
$application->expects($this->any())
482482
->method('getTerminalWidth')
@@ -514,7 +514,7 @@ public function testAutoExitSetting()
514514

515515
public function testRenderException()
516516
{
517-
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
517+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
518518
$application->setAutoExit(false);
519519
$application->expects($this->any())
520520
->method('getTerminalWidth')
@@ -546,7 +546,7 @@ public function testRenderException()
546546
$tester->run(array('command' => 'foo3:bar'), array('decorated' => true, 'capture_stderr_separately' => true));
547547
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
548548

549-
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
549+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
550550
$application->setAutoExit(false);
551551
$application->expects($this->any())
552552
->method('getTerminalWidth')
@@ -559,7 +559,7 @@ public function testRenderException()
559559

560560
public function testRenderExceptionWithDoubleWidthCharacters()
561561
{
562-
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
562+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
563563
$application->setAutoExit(false);
564564
$application->expects($this->any())
565565
->method('getTerminalWidth')
@@ -575,7 +575,7 @@ public function testRenderExceptionWithDoubleWidthCharacters()
575575
$tester->run(array('command' => 'foo'), array('decorated' => true, 'capture_stderr_separately' => true));
576576
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
577577

578-
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
578+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
579579
$application->setAutoExit(false);
580580
$application->expects($this->any())
581581
->method('getTerminalWidth')
@@ -709,7 +709,7 @@ public function testRunReturnsIntegerExitCode()
709709
{
710710
$exception = new \Exception('', 4);
711711

712-
$application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
712+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
713713
$application->setAutoExit(false);
714714
$application->expects($this->once())
715715
->method('doRun')
@@ -724,7 +724,7 @@ public function testRunReturnsExitCodeOneForExceptionCodeZero()
724724
{
725725
$exception = new \Exception('', 0);
726726

727-
$application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
727+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
728728
$application->setAutoExit(false);
729729
$application->expects($this->once())
730730
->method('doRun')

0 commit comments

Comments
 (0)