Skip to content

Commit dec56a1

Browse files
committed
fixed obsolete getMock() usage
1 parent f0bccef commit dec56a1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/Compiler/PassConfigTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public function testPassOrdering()
2323
{
2424
$config = new PassConfig();
2525

26-
$pass1 = $this->getMock(CompilerPassInterface::class);
26+
$pass1 = $this->getMockBuilder(CompilerPassInterface::class)->getMock();
2727
$config->addPass($pass1, PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
2828

29-
$pass2 = $this->getMock(CompilerPassInterface::class);
29+
$pass2 = $this->getMockBuilder(CompilerPassInterface::class)->getMock();
3030
$config->addPass($pass2, PassConfig::TYPE_BEFORE_OPTIMIZATION, 30);
3131

3232
$this->assertSame(array($pass2, $pass1), $config->getBeforeOptimizationPasses());

Tests/ContainerBuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ public function testAddGetCompilerPass()
284284
$builder = new ContainerBuilder();
285285
$builder->setResourceTracking(false);
286286
$defaultPasses = $builder->getCompiler()->getPassConfig()->getPasses();
287-
$builder->addCompilerPass($pass1 = $this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface'), PassConfig::TYPE_BEFORE_OPTIMIZATION, -5);
288-
$builder->addCompilerPass($pass2 = $this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface'), PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
287+
$builder->addCompilerPass($pass1 = $this->getMockBuilder('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface')->getMock(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -5);
288+
$builder->addCompilerPass($pass2 = $this->getMockBuilder('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface')->getMock(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
289289

290290
$passes = $builder->getCompiler()->getPassConfig()->getPasses();
291291
$this->assertCount(count($passes) - 2, $defaultPasses);
@@ -648,7 +648,7 @@ public function testExtension()
648648

649649
public function testRegisteredButNotLoadedExtension()
650650
{
651-
$extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
651+
$extension = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface')->getMock();
652652
$extension->expects($this->once())->method('getAlias')->will($this->returnValue('project'));
653653
$extension->expects($this->never())->method('load');
654654

@@ -660,7 +660,7 @@ public function testRegisteredButNotLoadedExtension()
660660

661661
public function testRegisteredAndLoadedExtension()
662662
{
663-
$extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
663+
$extension = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface')->getMock();
664664
$extension->expects($this->exactly(2))->method('getAlias')->will($this->returnValue('project'));
665665
$extension->expects($this->once())->method('load')->with(array(array('foo' => 'bar')));
666666

0 commit comments

Comments
 (0)