6
6
namespace Magento \PageCache \Test \Unit \App ;
7
7
8
8
use Magento \PageCache \Model \Config ;
9
- use Magento \Store \Model \Store ;
10
9
use Magento \Store \Model \StoreManager ;
11
10
12
11
/**
@@ -96,10 +95,18 @@ public function afterGetValueDataProvider()
96
95
'Varnish + PageCache enabled ' => [Config::VARNISH , true , null , false , false ],
97
96
'Built-in + PageCache disabled ' => [Config::BUILT_IN , false , null , false , false ],
98
97
'Built-in + PageCache enabled ' => [Config::BUILT_IN , true , null , false , false ],
99
- 'Built-in, PageCache enabled, no user-agent exceptions ' =>
100
- [Config::BUILT_IN , true , 'aa123aa ' , false , 'aa123aa ' ],
101
- 'Built-in, PageCache enabled, with design exception ' =>
102
- [Config::BUILT_IN , true , 'aa123aa ' , '7 ' , 'DESIGN=7|aa123aa ' ]
98
+ 'Built-in, PageCache enabled, no user-agent exceptions ' => [Config::BUILT_IN ,
99
+ true ,
100
+ 'aa123aa ' ,
101
+ false ,
102
+ 'aa123aa '
103
+ ],
104
+ 'Built-in, PageCache enabled, with design exception ' => [Config::BUILT_IN ,
105
+ true ,
106
+ 'aa123aa ' ,
107
+ '7 ' ,
108
+ 'DESIGN=7|aa123aa '
109
+ ]
103
110
];
104
111
}
105
112
@@ -121,14 +128,16 @@ public function testAfterGetValueRunParamsCauseDifferentIdentifiers()
121
128
$ defaultRequestMock = clone $ this ->requestMock ;
122
129
$ defaultRequestMock ->expects ($ this ->any ())
123
130
->method ('getServerValue ' )
124
- ->willReturnCallback (function ($ param ) {
125
- if ($ param == StoreManager::PARAM_RUN_TYPE ) {
126
- return 'store ' ;
131
+ ->willReturnCallback (
132
+ function ($ param ) {
133
+ if ($ param == StoreManager::PARAM_RUN_TYPE ) {
134
+ return 'store ' ;
135
+ }
136
+ if ($ param == StoreManager::PARAM_RUN_CODE ) {
137
+ return 'default ' ;
138
+ }
127
139
}
128
- if ($ param == StoreManager::PARAM_RUN_CODE ) {
129
- return 'default ' ;
130
- }
131
- });
140
+ );
132
141
133
142
$ nullSha1 = 'da39a3ee5e6b4b0d3255bfef95601890afd80709 ' ;
134
143
@@ -143,14 +152,16 @@ public function testAfterGetValueRunParamsCauseDifferentIdentifiers()
143
152
$ otherRequestMock = clone $ this ->requestMock ;
144
153
$ otherRequestMock ->expects ($ this ->any ())
145
154
->method ('getServerValue ' )
146
- ->willReturnCallback (function ($ param ) {
147
- if ($ param == StoreManager::PARAM_RUN_TYPE ) {
148
- return 'store ' ;
149
- }
150
- if ($ param == StoreManager::PARAM_RUN_CODE ) {
151
- return 'klingon ' ;
155
+ ->willReturnCallback (
156
+ function ($ param ) {
157
+ if ($ param == StoreManager::PARAM_RUN_TYPE ) {
158
+ return 'store ' ;
159
+ }
160
+ if ($ param == StoreManager::PARAM_RUN_CODE ) {
161
+ return 'klingon ' ;
162
+ }
152
163
}
153
- } );
164
+ );
154
165
155
166
$ otherPlugin = new \Magento \PageCache \Model \App \CacheIdentifierPlugin (
156
167
$ this ->designExceptionsMock ,
0 commit comments