@@ -25,12 +25,25 @@ class ControllerAbstractTest extends \Magento\TestFramework\TestCase\AbstractCon
25
25
/** @var \PHPUnit_Framework_MockObject_MockObject | CookieManagerInterface */
26
26
private $ cookieManagerMock ;
27
27
28
+ /**
29
+ * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Serialize\Serializer\Json
30
+ */
31
+ private $ serializerMock ;
32
+
28
33
protected function setUp ()
29
34
{
30
35
$ testObjectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
31
36
32
37
$ this ->messageManager = $ this ->getMock (\Magento \Framework \Message \Manager::class, [], [], '' , false );
33
38
$ 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
+ );
34
47
$ this ->interpretationStrategyMock = $ this ->getMock (InterpretationStrategyInterface::class, [], [], '' , false );
35
48
$ this ->interpretationStrategyMock ->expects ($ this ->any ())
36
49
->method ('interpret ' )
@@ -58,6 +71,7 @@ function (MessageInterface $message) {
58
71
[\Magento \Framework \App \ResponseInterface::class, $ response ],
59
72
[\Magento \Framework \Message \Manager::class, $ this ->messageManager ],
60
73
[CookieManagerInterface::class, $ this ->cookieManagerMock ],
74
+ [\Magento \Framework \Serialize \Serializer \Json::class, $ this ->serializerMock ],
61
75
[InterpretationStrategyInterface::class, $ this ->interpretationStrategyMock ],
62
76
]
63
77
)
0 commit comments