Skip to content

Commit d554588

Browse files
committed
fixed obsolete getMock() usage
1 parent 6dae522 commit d554588

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Tests/Controller/ControllerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function getContainerWithTokenStorage($token = null)
132132

133133
public function testJson()
134134
{
135-
$container = $this->getMock(ContainerInterface::class);
135+
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
136136
$container
137137
->expects($this->once())
138138
->method('has')
@@ -149,14 +149,14 @@ public function testJson()
149149

150150
public function testJsonWithSerializer()
151151
{
152-
$container = $this->getMock(ContainerInterface::class);
152+
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
153153
$container
154154
->expects($this->once())
155155
->method('has')
156156
->with('serializer')
157157
->will($this->returnValue(true));
158158

159-
$serializer = $this->getMock(SerializerInterface::class);
159+
$serializer = $this->getMockBuilder(SerializerInterface::class)->getMock();
160160
$serializer
161161
->expects($this->once())
162162
->method('serialize')
@@ -179,14 +179,14 @@ public function testJsonWithSerializer()
179179

180180
public function testJsonWithSerializerContextOverride()
181181
{
182-
$container = $this->getMock(ContainerInterface::class);
182+
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
183183
$container
184184
->expects($this->once())
185185
->method('has')
186186
->with('serializer')
187187
->will($this->returnValue(true));
188188

189-
$serializer = $this->getMock(SerializerInterface::class);
189+
$serializer = $this->getMockBuilder(SerializerInterface::class)->getMock();
190190
$serializer
191191
->expects($this->once())
192192
->method('serialize')

Tests/DependencyInjection/Compiler/ConfigCachePassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testThatCheckersAreProcessedInPriorityOrder()
2525
);
2626

2727
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
28-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds', 'getDefinition', 'hasDefinition'))->getMock();
28+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->getMock()->setMethods(array('findTaggedServiceIds', 'getDefinition', 'hasDefinition'))->getMock();
2929

3030
$container->expects($this->atLeastOnce())
3131
->method('findTaggedServiceIds')
@@ -50,7 +50,7 @@ public function testThatCheckersAreProcessedInPriorityOrder()
5050
public function testThatCheckersCanBeMissing()
5151
{
5252
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
53-
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds'))->getMock();
53+
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->getMock()->setMethods(array('findTaggedServiceIds'))->getMock();
5454

5555
$container->expects($this->atLeastOnce())
5656
->method('findTaggedServiceIds')

Tests/Templating/GlobalVariablesTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testGetUserNoTokenStorage()
3333

3434
public function testGetUserNoToken()
3535
{
36-
$tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface');
36+
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
3737
$this->container->set('security.token_storage', $tokenStorage);
3838
$this->assertNull($this->globals->getUser());
3939
}
@@ -43,8 +43,8 @@ public function testGetUserNoToken()
4343
*/
4444
public function testGetUser($user, $expectedUser)
4545
{
46-
$tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface');
47-
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
46+
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
47+
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
4848

4949
$this->container->set('security.token_storage', $tokenStorage);
5050

@@ -63,9 +63,9 @@ public function testGetUser($user, $expectedUser)
6363

6464
public function getUserProvider()
6565
{
66-
$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
66+
$user = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
6767
$std = new \stdClass();
68-
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
68+
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
6969

7070
return array(
7171
array($user, $user),

0 commit comments

Comments
 (0)