Skip to content

Commit 8cd3d3a

Browse files
committed
#10320: Remove zend json from the test suite
- Fixed unit test for the integration tests framework
1 parent 2867a11 commit 8cd3d3a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,25 @@ class ControllerAbstractTest extends \Magento\TestFramework\TestCase\AbstractCon
2525
/** @var \PHPUnit_Framework_MockObject_MockObject | CookieManagerInterface */
2626
private $cookieManagerMock;
2727

28+
/**
29+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Serialize\Serializer\Json
30+
*/
31+
private $serializerMock;
32+
2833
protected function setUp()
2934
{
3035
$testObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
3136

3237
$this->messageManager = $this->getMock(\Magento\Framework\Message\Manager::class, [], [], '', false);
3338
$this->cookieManagerMock = $this->getMock(CookieManagerInterface::class, [], [], '', false);
39+
$this->serializerMock = $this->getMockBuilder(\Magento\Framework\Serialize\Serializer\Json::class)
40+
->disableOriginalConstructor()
41+
->getMock();
42+
$this->serializerMock->expects($this->any())->method('unserialize')->willReturnCallback(
43+
function ($serializedData) {
44+
return json_decode($serializedData, true);
45+
}
46+
);
3447
$this->interpretationStrategyMock = $this->getMock(InterpretationStrategyInterface::class, [], [], '', false);
3548
$this->interpretationStrategyMock->expects($this->any())
3649
->method('interpret')
@@ -58,6 +71,7 @@ function (MessageInterface $message) {
5871
[\Magento\Framework\App\ResponseInterface::class, $response],
5972
[\Magento\Framework\Message\Manager::class, $this->messageManager],
6073
[CookieManagerInterface::class, $this->cookieManagerMock],
74+
[\Magento\Framework\Serialize\Serializer\Json::class, $this->serializerMock],
6175
[InterpretationStrategyInterface::class, $this->interpretationStrategyMock],
6276
]
6377
)

0 commit comments

Comments
 (0)