Skip to content

Commit 46b438b

Browse files
committed
fix unit test
1 parent 8ff52d8 commit 46b438b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

app/code/Magento/PageCache/Test/Unit/Model/App/Request/Http/IdentifierForSaveTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,18 +248,24 @@ public function testGetValueWithMarketingParameters(): void
248248
->method('getVaryString')
249249
->willReturn(self::VARY);
250250

251+
$uri = $this->createMock(HttpUri::class);
252+
$uri->expects($this->any())->method('getQueryAsArray')->willReturn(['abc' => '123']);
253+
$this->requestMock->expects($this->any())
254+
->method('getUri')
255+
->willReturn($uri);
256+
251257
$this->identifierStoreReader->method('getPageTagsWithStoreCacheTags')->willReturnCallback(
252258
function ($value) {
253259
return $value;
254260
}
255261
);
256-
257262
$this->assertEquals(
258263
sha1(
259264
json_encode(
260265
[
261266
true,
262-
'http://example.com/path1/?abc=123',
267+
'http://example.com/path1/',
268+
'abc=123',
263269
self::VARY
264270
]
265271
)

lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,19 @@ public function testGetValueWithMarketingParameters(): void
321321
->method('getVaryString')
322322
->willReturn(self::VARY);
323323

324+
$uri = $this->createMock(HttpUri::class);
325+
$uri->expects($this->any())->method('getQueryAsArray')->willReturn(['abc' => '123']);
326+
$this->requestMock->expects($this->any())
327+
->method('getUri')
328+
->willReturn($uri);
329+
324330
$this->assertEquals(
325331
sha1(
326332
json_encode(
327333
[
328334
true,
329-
'http://example.com/path1/?abc=123',
335+
'http://example.com/path1/',
336+
'abc=123',
330337
self::VARY
331338
]
332339
)

0 commit comments

Comments
 (0)