Skip to content

Commit 3372a73

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: 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 b78555a + de0a69c commit 3372a73

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function testRegressProgress()
294294

295295
public function testRedrawFrequency()
296296
{
297-
$bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream(), 6));
297+
$bar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')->setMethods(array('display'))->setConstructorArgs(array($this->getOutputStream(), 6))->getMock();
298298
$bar->expects($this->exactly(4))->method('display');
299299

300300
$bar->setRedrawFrequency(2);
@@ -307,7 +307,7 @@ public function testRedrawFrequency()
307307

308308
public function testRedrawFrequencyIsAtLeastOneIfZeroGiven()
309309
{
310-
$bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream()));
310+
$bar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')->setMethods(array('display'))->setConstructorArgs(array($this->getOutputStream()))->getMock();
311311

312312
$bar->expects($this->exactly(2))->method('display');
313313
$bar->setRedrawFrequency(0);
@@ -317,7 +317,7 @@ public function testRedrawFrequencyIsAtLeastOneIfZeroGiven()
317317

318318
public function testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven()
319319
{
320-
$bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream()));
320+
$bar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')->setMethods(array('display'))->setConstructorArgs(array($this->getOutputStream()))->getMock();
321321

322322
$bar->expects($this->exactly(2))->method('display');
323323
$bar->setRedrawFrequency(0.9);

Tests/Helper/QuestionHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public function testChoiceOutputFormattingQuestionForUtf8Keys()
388388
' [<info>żółw </info>] bar',
389389
' [<info>łabądź</info>] baz',
390390
);
391-
$output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
391+
$output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock();
392392
$output->method('getFormatter')->willReturn(new OutputFormatter());
393393

394394
$dialog = new QuestionHelper();
@@ -449,7 +449,7 @@ protected function createOutputInterface()
449449

450450
protected function createInputInterfaceMock($interactive = true)
451451
{
452-
$mock = $this->getMock('Symfony\Component\Console\Input\InputInterface');
452+
$mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
453453
$mock->expects($this->any())
454454
->method('isInteractive')
455455
->will($this->returnValue($interactive));

Tests/Helper/SymfonyQuestionHelperTest.php

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

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

0 commit comments

Comments
 (0)