File tree 2 files changed +17
-1
lines changed
lib/internal/Magento/Framework/App
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
namespace Magento \Framework \App ;
9
9
10
+ /**
11
+ * Lists router area codes & processes resolves FrontEndNames to area codes
12
+ */
10
13
class AreaList
11
14
{
12
15
/**
@@ -72,7 +75,7 @@ public function getCodeByFrontName($frontName)
72
75
$ resolver = $ this ->_resolverFactory ->create ($ areaInfo ['frontNameResolver ' ]);
73
76
$ areaInfo ['frontName ' ] = $ resolver ->getFrontName (true );
74
77
}
75
- if ($ areaInfo ['frontName ' ] == $ frontName ) {
78
+ if ($ areaInfo ['frontName ' ] === $ frontName ) {
76
79
return $ areaCode ;
77
80
}
78
81
}
Original file line number Diff line number Diff line change @@ -100,6 +100,19 @@ public function testGetFrontNameWhenAreaCodeAndFrontNameArentSet()
100
100
$ this ->assertSame ('test ' , $ model ->getArea ($ code ));
101
101
}
102
102
103
+ public function testGetFrontNameWhenFrontNameIsInvalid () : void
104
+ {
105
+ $ this ->_model = new AreaList (
106
+ $ this ->objectManagerMock ,
107
+ $ this ->_resolverFactory ,
108
+ [
109
+ 'testAreaCode ' => []
110
+ ]
111
+ );
112
+
113
+ $ this ->assertNull ($ this ->_model ->getFrontName ('0 ' ));
114
+ }
115
+
103
116
public function testGetCodes ()
104
117
{
105
118
$ areas = ['area1 ' => 'value1 ' , 'area2 ' => 'value2 ' ];
You can’t perform that action at this time.
0 commit comments