15
15
use Magento \Framework \Phrase \Renderer \Translate ;
16
16
17
17
/**
18
- * Class DataProviderTest
18
+ * Verify data provider translation
19
19
*
20
20
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21
21
*/
@@ -107,11 +107,6 @@ public function testGetData(array $config)
107
107
[$ areaCode , $ themePath , '* ' , '* ' , [$ filePaths [3 ]]]
108
108
];
109
109
110
- $ patterns = $ config ['patterns ' ];
111
- $ expectedResult = $ config ['expectedResult ' ];
112
- $ contentsMap = $ config ['contentsMap ' ];
113
- $ translateMap = $ config ['translateMap ' ];
114
-
115
110
$ this ->appStateMock ->expects ($ this ->once ())
116
111
->method ('getAreaCode ' )
117
112
->willReturn ($ areaCode );
@@ -122,23 +117,23 @@ public function testGetData(array $config)
122
117
->method ('getStaticHtmlFiles ' )
123
118
->willReturnMap ($ staticFilesMap );
124
119
125
- foreach ($ contentsMap as $ index => $ content ) {
120
+ foreach ($ config [ ' contentsMap ' ] as $ index => $ content ) {
126
121
$ this ->fileReadMock ->expects ($ this ->at ($ index ))
127
122
->method ('readAll ' )
128
123
->willReturn ($ content );
129
124
}
130
125
131
126
$ this ->configMock ->expects ($ this ->any ())
132
127
->method ('getPatterns ' )
133
- ->willReturn ($ patterns );
128
+ ->willReturn ($ config [ ' patterns ' ] );
134
129
$ this ->translateMock ->expects ($ this ->any ())
135
130
->method ('render ' )
136
- ->willReturnMap ($ translateMap );
131
+ ->willReturnMap ($ config [ ' translateMap ' ] );
137
132
138
133
$ actualResult = $ this ->model ->getData ($ themePath );
139
- $ this ->assertEquals ($ expectedResult , $ actualResult );
134
+ $ this ->assertEquals ($ config [ ' expectedResult ' ] , $ actualResult );
140
135
$ this ->assertEquals (
141
- json_encode ($ expectedResult ),
136
+ json_encode ($ config [ ' expectedResult ' ] ),
142
137
json_encode ($ actualResult ),
143
138
"Translations should be sorted by key "
144
139
);
0 commit comments