Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 047bd4b

Browse files
medliiiTekill
authored andcommitted
add serializer bundle v3
1 parent 5773ddd commit 047bd4b

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ext-json": "*",
1111
"doctrine/doctrine-bundle": "^1.9 || ^2.0",
1212
"doctrine/orm": "~2.3",
13-
"jms/serializer-bundle": "^2.4",
13+
"jms/serializer-bundle": "^2.4 || ^3.0",
1414
"php-amqplib/php-amqplib": "~2.6",
1515
"php-amqplib/rabbitmq-bundle": "~1.14.3",
1616
"symfony/config": "^4.1 || ^5.0",

tests/unit/Factory/EntityFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class EntityFactoryTest extends PHPUnit_Framework_TestCase
2626
*/
2727
public function testCreateQueue(AbstractJob $job, QueueEntityInterface $expected): void
2828
{
29-
$serializer = $this->getJMSSerializer(['serialize']);
29+
$serializer = $this->getJMSSerializer();
3030
$serializer->expects($this->once())
3131
->method('serialize')
3232
->willReturn('{"id":1}');
@@ -66,7 +66,7 @@ public function testJsonDecodeError(): void
6666
$this->expectExceptionCode(4);
6767
$this->expectExceptionMessage('json_decode error: Syntax error');
6868

69-
$serializer = $this->getJMSSerializer(['serialize']);
69+
$serializer = $this->getJMSSerializer();
7070
$serializer->expects($this->once())
7171
->method('serialize')
7272
->willReturn('abrakadabra');

tests/unit/SymfonyMockTrait.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Doctrine\ORM\EntityManager;
88
use JMS\Serializer\Serializer;
9+
use JMS\Serializer\SerializerInterface;
910
use Psr\Log\LoggerInterface;
1011
use Symfony\Component\Console\Input\ArgvInput;
1112
use Symfony\Component\Console\Output\ConsoleOutput;
@@ -53,15 +54,11 @@ protected function getMockLogger(array $methods = [])
5354
}
5455

5556
/**
56-
* @param array $methods
57-
*
5857
* @return Serializer | \PHPUnit_Framework_MockObject_MockObject
5958
*/
60-
protected function getJMSSerializer(array $methods = [])
59+
protected function getJMSSerializer()
6160
{
62-
return $this->getMockBuilder(Serializer::class)
63-
->disableOriginalConstructor()
64-
->setMethods($methods)
61+
return $this->getMockBuilder(SerializerInterface::class)
6562
->getMock();
6663
}
6764

0 commit comments

Comments
 (0)