@@ -116,7 +116,7 @@ public function testBeforeDispatchNoSuchEntity()
116
116
$ this ->storeManagerMock ->expects ($ this ->once ())
117
117
->method ('getDefaultStoreView ' )
118
118
->willReturn ($ this ->storeMock );
119
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ( ))
119
+ $ this ->storeCookieManagerMock ->expects ($ this ->exactly ( 2 ))
120
120
->method ('getStoreCodeFromCookie ' )
121
121
->willReturn ($ storeCode );
122
122
$ this ->storeRepositoryMock ->expects ($ this ->once ())
@@ -125,7 +125,7 @@ public function testBeforeDispatchNoSuchEntity()
125
125
$ this ->storeCookieManagerMock ->expects ($ this ->once ())
126
126
->method ('deleteStoreCookie ' )
127
127
->with ($ this ->storeMock );
128
- $ this ->requestMock ->expects ($ this ->atLeastOnce ())
128
+ $ this ->requestMock ->expects ($ this ->once ())
129
129
->method ('getParam ' )
130
130
->with (StoreResolverInterface::PARAM_NAME )
131
131
->willReturn (null );
@@ -139,7 +139,7 @@ public function testBeforeDispatchStoreIsInactive()
139
139
$ this ->storeManagerMock ->expects ($ this ->once ())
140
140
->method ('getDefaultStoreView ' )
141
141
->willReturn ($ this ->storeMock );
142
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ( ))
142
+ $ this ->storeCookieManagerMock ->expects ($ this ->exactly ( 2 ))
143
143
->method ('getStoreCodeFromCookie ' )
144
144
->willReturn ($ storeCode );
145
145
$ this ->storeRepositoryMock ->expects ($ this ->once ())
@@ -148,7 +148,7 @@ public function testBeforeDispatchStoreIsInactive()
148
148
$ this ->storeCookieManagerMock ->expects ($ this ->once ())
149
149
->method ('deleteStoreCookie ' )
150
150
->with ($ this ->storeMock );
151
- $ this ->requestMock ->expects ($ this ->atLeastOnce ())
151
+ $ this ->requestMock ->expects ($ this ->once ())
152
152
->method ('getParam ' )
153
153
->with (StoreResolverInterface::PARAM_NAME )
154
154
->willReturn (null );
@@ -162,7 +162,7 @@ public function testBeforeDispatchInvalidArgument()
162
162
$ this ->storeManagerMock ->expects ($ this ->once ())
163
163
->method ('getDefaultStoreView ' )
164
164
->willReturn ($ this ->storeMock );
165
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ( ))
165
+ $ this ->storeCookieManagerMock ->expects ($ this ->exactly ( 2 ))
166
166
->method ('getStoreCodeFromCookie ' )
167
167
->willReturn ($ storeCode );
168
168
$ this ->storeRepositoryMock ->expects ($ this ->once ())
@@ -171,7 +171,7 @@ public function testBeforeDispatchInvalidArgument()
171
171
$ this ->storeCookieManagerMock ->expects ($ this ->once ())
172
172
->method ('deleteStoreCookie ' )
173
173
->with ($ this ->storeMock );
174
- $ this ->requestMock ->expects ($ this ->atLeastOnce ())
174
+ $ this ->requestMock ->expects ($ this ->once ())
175
175
->method ('getParam ' )
176
176
->with (StoreResolverInterface::PARAM_NAME )
177
177
->willReturn (null );
@@ -182,7 +182,7 @@ public function testBeforeDispatchInvalidArgument()
182
182
public function testBeforeDispatchNoStoreCookie ()
183
183
{
184
184
$ storeCode = null ;
185
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ( ))
185
+ $ this ->storeCookieManagerMock ->expects ($ this ->exactly ( 2 ))
186
186
->method ('getStoreCodeFromCookie ' )
187
187
->willReturn ($ storeCode );
188
188
$ this ->storeManagerMock ->expects ($ this ->never ())
@@ -194,15 +194,15 @@ public function testBeforeDispatchNoStoreCookie()
194
194
->method ('deleteStoreCookie ' )
195
195
->with ($ this ->storeMock );
196
196
197
- $ this ->storeResolverMock ->expects ($ this ->atLeastOnce ())
197
+ $ this ->storeResolverMock ->expects ($ this ->once ())
198
198
->method ('getCurrentStoreId ' )
199
199
->willReturn (1 );
200
200
201
- $ this ->storeRepositoryMock ->expects ($ this ->atLeastOnce ())
201
+ $ this ->storeRepositoryMock ->expects ($ this ->once ())
202
202
->method ('getActiveStoreById ' )
203
203
->willReturn ($ this ->storeMock );
204
204
205
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ())
205
+ $ this ->storeCookieManagerMock ->expects ($ this ->once ())
206
206
->method ('setStoreCookie ' )
207
207
->with ($ this ->storeMock );
208
208
@@ -212,30 +212,30 @@ public function testBeforeDispatchNoStoreCookie()
212
212
public function testBeforeDispatchWithStoreRequestParam ()
213
213
{
214
214
$ storeCode = 'store ' ;
215
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ( ))
215
+ $ this ->storeCookieManagerMock ->expects ($ this ->exactly ( 2 ))
216
216
->method ('getStoreCodeFromCookie ' )
217
217
->willReturn ($ storeCode );
218
- $ this ->storeRepositoryMock ->expects ($ this ->atLeastOnce ())
218
+ $ this ->storeRepositoryMock ->expects ($ this ->once ())
219
219
->method ('getActiveStoreByCode ' )
220
220
->willReturn ($ this ->storeMock );
221
221
$ this ->storeCookieManagerMock ->expects ($ this ->never ())
222
222
->method ('deleteStoreCookie ' )
223
223
->with ($ this ->storeMock );
224
224
225
- $ this ->requestMock ->expects ($ this ->atLeastOnce ())
225
+ $ this ->requestMock ->expects ($ this ->once ())
226
226
->method ('getParam ' )
227
227
->with (StoreResolverInterface::PARAM_NAME )
228
228
->willReturn ($ storeCode );
229
229
230
- $ this ->storeResolverMock ->expects ($ this ->atLeastOnce ())
230
+ $ this ->storeResolverMock ->expects ($ this ->once ())
231
231
->method ('getCurrentStoreId ' )
232
232
->willReturn (1 );
233
233
234
- $ this ->storeRepositoryMock ->expects ($ this ->atLeastOnce ())
234
+ $ this ->storeRepositoryMock ->expects ($ this ->once ())
235
235
->method ('getActiveStoreById ' )
236
236
->willReturn ($ this ->storeMock );
237
237
238
- $ this ->storeCookieManagerMock ->expects ($ this ->atLeastOnce ())
238
+ $ this ->storeCookieManagerMock ->expects ($ this ->once ())
239
239
->method ('setStoreCookie ' )
240
240
->with ($ this ->storeMock );
241
241
0 commit comments