File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,10 @@ private function processRequest(
184
184
185
185
//Validating a request only once.
186
186
if (!$ this ->validatedRequest ) {
187
+ $ area = $ this ->areaList ->getArea ($ this ->appState ->getAreaCode ());
188
+ $ area ->load (Area::PART_DESIGN );
189
+ $ area ->load (Area::PART_TRANSLATE );
190
+
187
191
try {
188
192
$ this ->requestValidator ->validate ($ request , $ actionInstance );
189
193
} catch (InvalidRequestException $ exception ) {
@@ -193,9 +197,6 @@ private function processRequest(
193
197
["exception " => $ exception ]
194
198
);
195
199
$ result = $ exception ->getReplaceResult ();
196
- $ area = $ this ->areaList ->getArea ($ this ->appState ->getAreaCode ());
197
- $ area ->load (Area::PART_DESIGN );
198
- $ area ->load (Area::PART_TRANSLATE );
199
200
if ($ messages = $ exception ->getMessages ()) {
200
201
foreach ($ messages as $ message ) {
201
202
$ this ->messages ->addErrorMessage ($ message );
Original file line number Diff line number Diff line change @@ -226,7 +226,10 @@ public function testDispatched()
226
226
$ this ->routerList ->expects ($ this ->any ())
227
227
->method ('current ' )
228
228
->willReturn ($ this ->router );
229
-
229
+ $ this ->appStateMock ->expects ($ this ->any ())->method ('getAreaCode ' )->willReturn ('frontend ' );
230
+ $ this ->areaMock ->expects ($ this ->at (0 ))->method ('load ' )->with (Area::PART_DESIGN )->willReturnSelf ();
231
+ $ this ->areaMock ->expects ($ this ->at (1 ))->method ('load ' )->with (Area::PART_TRANSLATE )->willReturnSelf ();
232
+ $ this ->areaListMock ->expects ($ this ->any ())->method ('getArea ' )->willReturn ($ this ->areaMock );
230
233
$ this ->request ->expects ($ this ->at (0 ))->method ('isDispatched ' )->willReturn (false );
231
234
$ this ->request ->expects ($ this ->at (1 ))->method ('setDispatched ' )->with (true );
232
235
$ this ->request ->expects ($ this ->at (2 ))->method ('isDispatched ' )->willReturn (true );
@@ -261,6 +264,10 @@ public function testDispatchedNotFoundException()
261
264
->method ('current ' )
262
265
->willReturn ($ this ->router );
263
266
267
+ $ this ->appStateMock ->expects ($ this ->any ())->method ('getAreaCode ' )->willReturn ('frontend ' );
268
+ $ this ->areaMock ->expects ($ this ->at (0 ))->method ('load ' )->with (Area::PART_DESIGN )->willReturnSelf ();
269
+ $ this ->areaMock ->expects ($ this ->at (1 ))->method ('load ' )->with (Area::PART_TRANSLATE )->willReturnSelf ();
270
+ $ this ->areaListMock ->expects ($ this ->any ())->method ('getArea ' )->willReturn ($ this ->areaMock );
264
271
$ this ->request ->expects ($ this ->at (0 ))->method ('isDispatched ' )->willReturn (false );
265
272
$ this ->request ->expects ($ this ->at (1 ))->method ('initForward ' );
266
273
$ this ->request ->expects ($ this ->at (2 ))->method ('setActionName ' )->with ('noroute ' );
You can’t perform that action at this time.
0 commit comments