Skip to content

Commit c7a2075

Browse files
committed
Merge branch '3.2'
* 3.2: fixed obsolete getMock() usage fixed obsolete getMock() usage fixed obsolete getMock() usage fixed obsolete getMock() usage [WebProfilerBundle] Display multiple HTTP headers in WDT do not remove the Twig ExceptionController service removed obsolete condition do not try to register incomplete definitions
2 parents dc7074a + 427d11b commit c7a2075

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Tests/ApplicationTest.php

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

467467
public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
468468
{
469-
$application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces'));
469+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getNamespaces'))->getMock();
470470
$application->expects($this->once())
471471
->method('getNamespaces')
472472
->will($this->returnValue(array('foo:sublong', 'bar:sub')));
@@ -713,7 +713,7 @@ public function testRunReturnsIntegerExitCode()
713713
{
714714
$exception = new \Exception('', 4);
715715

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

731-
$application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
731+
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
732732
$application->setAutoExit(false);
733733
$application->expects($this->once())
734734
->method('doRun')

Tests/Command/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function testRunReturnsIntegerExitCode()
273273
$exitCode = $command->run(new StringInput(''), new NullOutput());
274274
$this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)');
275275

276-
$command = $this->getMock('TestCommand', array('execute'));
276+
$command = $this->getMockBuilder('TestCommand')->setMethods(array('execute'))->getMock();
277277
$command->expects($this->once())
278278
->method('execute')
279279
->will($this->returnValue('2.3'));

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/HelperSetTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testIteration()
110110

111111
private function getGenericMockHelper($name, HelperSet $helperset = null)
112112
{
113-
$mock_helper = $this->getMock('\Symfony\Component\Console\Helper\HelperInterface');
113+
$mock_helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\HelperInterface')->getMock();
114114
$mock_helper->expects($this->any())
115115
->method('getName')
116116
->will($this->returnValue($name));

Tests/Helper/QuestionHelperTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public function testChoiceOutputFormattingQuestionForUtf8Keys()
380380
' [<info>żółw </info>] bar',
381381
' [<info>łabądź</info>] baz',
382382
);
383-
$output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
383+
$output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock();
384384
$output->method('getFormatter')->willReturn(new OutputFormatter());
385385

386386
$dialog = new QuestionHelper();
@@ -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();
@@ -788,7 +788,7 @@ protected function createOutputInterface()
788788

789789
protected function createInputInterfaceMock($interactive = true)
790790
{
791-
$mock = $this->getMock('Symfony\Component\Console\Input\InputInterface');
791+
$mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
792792
$mock->expects($this->any())
793793
->method('isInteractive')
794794
->will($this->returnValue($interactive));

Tests/Helper/SymfonyQuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected function createOutputInterface()
130130

131131
protected function createInputInterfaceMock($interactive = true)
132132
{
133-
$mock = $this->getMock('Symfony\Component\Console\Input\InputInterface');
133+
$mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
134134
$mock->expects($this->any())
135135
->method('isInteractive')
136136
->will($this->returnValue($interactive));

0 commit comments

Comments
 (0)