File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
app/code/Magento/PageCache/Test/Unit/Model/App/Request/Http Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \Framework \App \Request \Http as HttpRequest ;
12
12
use Magento \Framework \Serialize \Serializer \Json ;
13
13
use Magento \PageCache \Model \App \Request \Http \IdentifierForSave ;
14
+ use Magento \PageCache \Model \App \Request \Http \IdentifierStoreReader ;
14
15
use PHPUnit \Framework \MockObject \MockObject ;
15
16
use PHPUnit \Framework \TestCase ;
16
17
@@ -40,6 +41,10 @@ class IdentifierForSaveTest extends TestCase
40
41
* @var Json|MockObject
41
42
*/
42
43
private mixed $ serializerMock ;
44
+ /**
45
+ * @var IdentifierStoreReader|MockObject
46
+ */
47
+ private $ identifierStoreReader ;
43
48
44
49
/**
45
50
* @inheritdoc
@@ -64,10 +69,16 @@ function ($value) {
64
69
}
65
70
);
66
71
72
+ $ this ->identifierStoreReader = $ this ->getMockBuilder (IdentifierStoreReader::class)
73
+ ->onlyMethods (['getPageTagsWithStoreCacheTags ' ])
74
+ ->disableOriginalConstructor ()
75
+ ->getMock ();
76
+
67
77
$ this ->model = new IdentifierForSave (
68
78
$ this ->requestMock ,
69
79
$ this ->contextMock ,
70
- $ this ->serializerMock
80
+ $ this ->serializerMock ,
81
+ $ this ->identifierStoreReader
71
82
);
72
83
parent ::setUp ();
73
84
}
@@ -91,6 +102,12 @@ public function testGetValue(): void
91
102
->method ('getVaryString ' )
92
103
->willReturn (self ::VARY );
93
104
105
+ $ this ->identifierStoreReader ->method ('getPageTagsWithStoreCacheTags ' )->willReturnCallback (
106
+ function ($ value ) {
107
+ return $ value ;
108
+ }
109
+ );
110
+
94
111
$ this ->assertEquals (
95
112
sha1 (
96
113
json_encode (
You can’t perform that action at this time.
0 commit comments