Skip to content

Commit 395827d

Browse files
committed
MAGETWO-66414: Remove usages of serialize/unserialize in framework
- Replace usage of serialize with mock strings
1 parent 33ee1b0 commit 395827d

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ protected function tearDown()
8484

8585
public function testSendVary()
8686
{
87-
$data = ['some-vary-key' => 'some-vary-value'];
8887
$expectedCookieName = Http::COOKIE_VARY_STRING;
89-
$expectedCookieValue = sha1(serialize($data));
88+
$expectedCookieValue = 'SHA1 Serialized String';
9089
$sensitiveCookieMetadataMock = $this->getMockBuilder(
9190
\Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class)
9291
->disableOriginalConstructor()

lib/internal/Magento/Framework/Filter/Test/Unit/TemplateTest.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ public function varDirectiveDataProvider()
149149

150150
$stub->expects($this->once())
151151
->method('bar')
152-
->will($this->returnCallback(function ($arg) {
153-
return serialize($arg);
154-
}));
152+
->willReturn('Mocked Method Return');
155153

156154
return [
157155
'no variables' => [
@@ -177,14 +175,7 @@ public function varDirectiveDataProvider()
177175
'b' => 'bee',
178176
'd' => 'dee',
179177
],
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'
188179
],
189180
];
190181
}

0 commit comments

Comments
 (0)