Skip to content

Commit fb9f21d

Browse files
committed
fixed obsolete getMock() usage
1 parent 862121b commit fb9f21d

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Tests/Controller/ControllerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ public function testJsonWithSerializerContextOverride()
215215
public function testFile()
216216
{
217217
/* @var ContainerInterface $container */
218-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
219-
$kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
218+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
219+
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
220220
$container->set('kernel', $kernel);
221221

222222
$controller = new TestController();
@@ -235,7 +235,7 @@ public function testFile()
235235

236236
public function testFileAsInline()
237237
{
238-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
238+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
239239
$controller = new TestController();
240240
$controller->setContainer($container);
241241

@@ -253,7 +253,7 @@ public function testFileAsInline()
253253

254254
public function testFileWithOwnFileName()
255255
{
256-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
256+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
257257
$controller = new TestController();
258258
$controller->setContainer($container);
259259

@@ -272,7 +272,7 @@ public function testFileWithOwnFileName()
272272

273273
public function testFileWithOwnFileNameAsInline()
274274
{
275-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
275+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
276276
$controller = new TestController();
277277
$controller->setContainer($container);
278278

Tests/DependencyInjection/Compiler/ConfigCachePassTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ public function testThatCheckersAreProcessedInPriorityOrder()
2424
'checker_3' => array(0 => array()),
2525
);
2626

27-
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
28-
$container = $this->getMock(
29-
'Symfony\Component\DependencyInjection\ContainerBuilder',
30-
array('findTaggedServiceIds', 'getDefinition', 'hasDefinition')
31-
);
27+
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
28+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds', 'getDefinition', 'hasDefinition'))->getMock();
3229

3330
$container->expects($this->atLeastOnce())
3431
->method('findTaggedServiceIds')
@@ -52,10 +49,7 @@ public function testThatCheckersAreProcessedInPriorityOrder()
5249

5350
public function testThatCheckersCanBeMissing()
5451
{
55-
$container = $this->getMock(
56-
'Symfony\Component\DependencyInjection\ContainerBuilder',
57-
array('findTaggedServiceIds')
58-
);
52+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds'))->getMock();
5953

6054
$container->expects($this->atLeastOnce())
6155
->method('findTaggedServiceIds')

0 commit comments

Comments
 (0)