File tree Expand file tree Collapse file tree 3 files changed +13
-22
lines changed
app/code/Magento/Config/Test/Unit/App/Config/Type
lib/internal/Magento/Framework Expand file tree Collapse file tree 3 files changed +13
-22
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public function testGet($isCached)
88
88
{
89
89
$ path = 'default/dev/unsecure/url ' ;
90
90
$ url = 'http://magento.test/ ' ;
91
- $ data = [
91
+ $ unserializedData = [
92
92
'default ' => [
93
93
'dev ' => [
94
94
'unsecure ' => [
@@ -97,41 +97,42 @@ public function testGet($isCached)
97
97
]
98
98
]
99
99
];
100
+ $ serializedDataString = '{"serialized-data"} ' ;
100
101
101
102
$ this ->cache ->expects ($ this ->once ())
102
103
->method ('load ' )
103
104
->with (System::CONFIG_TYPE )
104
- ->willReturn ($ isCached ? $ data : null );
105
+ ->willReturn ($ isCached ? $ unserializedData : null );
105
106
106
107
if ($ isCached ) {
107
108
$ this ->serializer ->expects ($ this ->once ())
108
109
->method ('unserialize ' )
109
- ->willReturn ($ data );
110
+ ->willReturn ($ unserializedData );
110
111
}
111
112
112
113
if (!$ isCached ) {
113
114
$ this ->serializer ->expects ($ this ->once ())
114
115
->method ('serialize ' )
115
- ->willReturn (serialize ( $ data ) );
116
+ ->willReturn ($ serializedDataString );
116
117
$ this ->source ->expects ($ this ->once ())
117
118
->method ('get ' )
118
- ->willReturn ($ data );
119
+ ->willReturn ($ unserializedData );
119
120
$ this ->fallback ->expects ($ this ->once ())
120
121
->method ('process ' )
121
- ->with ($ data )
122
+ ->with ($ unserializedData )
122
123
->willReturnArgument (0 );
123
124
$ this ->preProcessor ->expects ($ this ->once ())
124
125
->method ('process ' )
125
- ->with ($ data )
126
+ ->with ($ unserializedData )
126
127
->willReturnArgument (0 );
127
128
$ this ->postProcessor ->expects ($ this ->once ())
128
129
->method ('process ' )
129
- ->with ($ data )
130
+ ->with ($ unserializedData )
130
131
->willReturnArgument (0 );
131
132
$ this ->cache ->expects ($ this ->once ())
132
133
->method ('save ' )
133
134
->with (
134
- serialize ( $ data ) ,
135
+ $ serializedDataString ,
135
136
System::CONFIG_TYPE ,
136
137
[System::CACHE_TAG ]
137
138
);
Original file line number Diff line number Diff line change @@ -84,9 +84,8 @@ protected function tearDown()
84
84
85
85
public function testSendVary ()
86
86
{
87
- $ data = ['some-vary-key ' => 'some-vary-value ' ];
88
87
$ expectedCookieName = Http::COOKIE_VARY_STRING ;
89
- $ expectedCookieValue = sha1 ( serialize ( $ data )) ;
88
+ $ expectedCookieValue = ' SHA1 Serialized String ' ;
90
89
$ sensitiveCookieMetadataMock = $ this ->getMockBuilder (
91
90
\Magento \Framework \Stdlib \Cookie \SensitiveCookieMetadata::class)
92
91
->disableOriginalConstructor ()
Original file line number Diff line number Diff line change @@ -149,9 +149,7 @@ public function varDirectiveDataProvider()
149
149
150
150
$ stub ->expects ($ this ->once ())
151
151
->method ('bar ' )
152
- ->will ($ this ->returnCallback (function ($ arg ) {
153
- return serialize ($ arg );
154
- }));
152
+ ->willReturn ('Mocked Method Return ' );
155
153
156
154
return [
157
155
'no variables ' => [
@@ -177,14 +175,7 @@ public function varDirectiveDataProvider()
177
175
'b ' => 'bee ' ,
178
176
'd ' => 'dee ' ,
179
177
],
180
- serialize ([
181
- 'param_1 ' => 'value_1 ' ,
182
- 'param_2 ' => 'lorem ' ,
183
- 'param_3 ' => [
184
- 'a ' => 'bee ' ,
185
- 'c ' => 'dee ' ,
186
- ],
187
- ]),
178
+ 'Mocked Method Return '
188
179
],
189
180
];
190
181
}
You can’t perform that action at this time.
0 commit comments