Skip to content

Commit 043c69f

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 d1361e0 + e81e020 commit 043c69f

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Tests/Compiler/ExtensionCompilerPassTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ExtensionCompilerPassTest extends \PHPUnit_Framework_TestCase
2323

2424
protected function setUp()
2525
{
26-
$this->container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
26+
$this->container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->getMock();
2727
$this->pass = new ExtensionCompilerPass();
2828
}
2929

@@ -46,10 +46,10 @@ public function testProcess()
4646

4747
private function createExtensionMock($hasInlineCompile)
4848
{
49-
return $this->getMock('Symfony\Component\DependencyInjection\\'.(
49+
return $this->getMockBuilder('Symfony\Component\DependencyInjection\\'.(
5050
$hasInlineCompile
5151
? 'Compiler\CompilerPassInterface'
5252
: 'Extension\ExtensionInterface'
53-
));
53+
))->getMock();
5454
}
5555
}

Tests/Compiler/MergeExtensionConfigurationPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testExpressionLanguageProviderForwarding()
2121
{
2222
$tmpProviders = array();
2323

24-
$extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
24+
$extension = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface')->getMock();
2525
$extension->expects($this->any())
2626
->method('getXsdValidationBasePath')
2727
->will($this->returnValue(false));
@@ -37,7 +37,7 @@ public function testExpressionLanguageProviderForwarding()
3737
$tmpProviders = $container->getExpressionLanguageProviders();
3838
}));
3939

40-
$provider = $this->getMock('Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface');
40+
$provider = $this->getMockBuilder('Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface')->getMock();
4141
$container = new ContainerBuilder(new ParameterBag());
4242
$container->registerExtension($extension);
4343
$container->prependExtensionConfig('foo', array('bar' => true));

Tests/ContainerBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function testAddGetCompilerPass()
254254
$builder = new ContainerBuilder();
255255
$builder->setResourceTracking(false);
256256
$builderCompilerPasses = $builder->getCompiler()->getPassConfig()->getPasses();
257-
$builder->addCompilerPass($this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface'));
257+
$builder->addCompilerPass($this->getMockBuilder('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface')->getMock());
258258

259259
$this->assertCount(count($builder->getCompiler()->getPassConfig()->getPasses()) - 1, $builderCompilerPasses);
260260
}
@@ -608,7 +608,7 @@ public function testExtension()
608608

609609
public function testRegisteredButNotLoadedExtension()
610610
{
611-
$extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
611+
$extension = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface')->getMock();
612612
$extension->expects($this->once())->method('getAlias')->will($this->returnValue('project'));
613613
$extension->expects($this->never())->method('load');
614614

@@ -620,7 +620,7 @@ public function testRegisteredButNotLoadedExtension()
620620

621621
public function testRegisteredAndLoadedExtension()
622622
{
623-
$extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
623+
$extension = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface')->getMock();
624624
$extension->expects($this->exactly(2))->method('getAlias')->will($this->returnValue('project'));
625625
$extension->expects($this->once())->method('load')->with(array(array('foo' => 'bar')));
626626

Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testInstantiateProxy()
2525
{
2626
$instantiator = new RealServiceInstantiator();
2727
$instance = new \stdClass();
28-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
28+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
2929
$callback = function () use ($instance) {
3030
return $instance;
3131
};

0 commit comments

Comments
 (0)