Skip to content

Commit 7da5e62

Browse files
committed
fixed obsolete getMock() usage
1 parent 0fb2237 commit 7da5e62

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Tests/Mapping/Factory/CacheMetadataFactoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testGetMetadataFor()
2626
{
2727
$metadata = new ClassMetadata(Dummy::class);
2828

29-
$decorated = $this->getMock(ClassMetadataFactoryInterface::class);
29+
$decorated = $this->getMockBuilder(ClassMetadataFactoryInterface::class)->getMock();
3030
$decorated
3131
->expects($this->once())
3232
->method('getMetadataFor')
@@ -42,7 +42,7 @@ public function testGetMetadataFor()
4242

4343
public function testHasMetadataFor()
4444
{
45-
$decorated = $this->getMock(ClassMetadataFactoryInterface::class);
45+
$decorated = $this->getMockBuilder(ClassMetadataFactoryInterface::class)->getMock();
4646
$decorated
4747
->expects($this->once())
4848
->method('hasMetadataFor')
@@ -59,7 +59,7 @@ public function testHasMetadataFor()
5959
*/
6060
public function testInvalidClassThrowsException()
6161
{
62-
$decorated = $this->getMock(ClassMetadataFactoryInterface::class);
62+
$decorated = $this->getMockBuilder(ClassMetadataFactoryInterface::class)->getMock();
6363
$factory = new CacheClassMetadataFactory($decorated, new ArrayAdapter());
6464

6565
$factory->getMetadataFor('Not\Exist');

Tests/Mapping/Factory/ClassMetadataFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testHasMetadataFor()
5050
*/
5151
public function testCacheExists()
5252
{
53-
$cache = $this->getMock('Doctrine\Common\Cache\Cache');
53+
$cache = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
5454
$cache
5555
->expects($this->once())
5656
->method('fetch')
@@ -66,7 +66,7 @@ public function testCacheExists()
6666
*/
6767
public function testCacheNotExists()
6868
{
69-
$cache = $this->getMock('Doctrine\Common\Cache\Cache');
69+
$cache = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
7070
$cache->method('fetch')->will($this->returnValue(false));
7171
$cache->method('save');
7272

Tests/Normalizer/JsonSerializableNormalizerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class JsonSerializableNormalizerTest extends \PHPUnit_Framework_TestCase
3333

3434
protected function setUp()
3535
{
36-
$this->serializer = $this->getMock(JsonSerializerNormalizer::class);
36+
$this->serializer = $this->getMockBuilder(JsonSerializerNormalizer::class)->getMock();
3737
$this->normalizer = new JsonSerializableNormalizer();
3838
$this->normalizer->setSerializer($this->serializer);
3939
}

Tests/SerializerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function testDeserializeArray()
319319

320320
public function testNormalizerAware()
321321
{
322-
$normalizerAware = $this->getMock(NormalizerAwareInterface::class);
322+
$normalizerAware = $this->getMockBuilder(NormalizerAwareInterface::class)->getMock();
323323
$normalizerAware->expects($this->once())
324324
->method('setNormalizer')
325325
->with($this->isInstanceOf(NormalizerInterface::class));
@@ -329,7 +329,7 @@ public function testNormalizerAware()
329329

330330
public function testDenormalizerAware()
331331
{
332-
$denormalizerAware = $this->getMock(DenormalizerAwareInterface::class);
332+
$denormalizerAware = $this->getMockBuilder(DenormalizerAwareInterface::class)->getMock();
333333
$denormalizerAware->expects($this->once())
334334
->method('setDenormalizer')
335335
->with($this->isInstanceOf(DenormalizerInterface::class));

0 commit comments

Comments
 (0)