File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,22 @@ private function getExpectedFiltersDataSet()
153
153
*/
154
154
private function assertFilters ($ response , $ expectedFilters , $ message = '' )
155
155
{
156
- $ this ->assertEquals ($ expectedFilters , $ response ['products ' ]['filters ' ], $ message );
156
+ $ this ->assertArrayHasKey ('filters ' , $ response ['products ' ], 'Product has filters ' );
157
+ $ this ->assertTrue (is_array (($ response ['products ' ]['filters ' ])), 'Product filters is array ' );
158
+ $ this ->assertTrue (count ($ response ['products ' ]['filters ' ]) > 0 , 'Product filters is not empty ' );
159
+ foreach ($ expectedFilters as $ expectedFilter ) {
160
+ $ found = false ;
161
+ foreach ($ response ['products ' ]['filters ' ] as $ responseFilter ) {
162
+ if ($ responseFilter ['name ' ] == $ expectedFilter ['name ' ]
163
+ && $ responseFilter ['request_var ' ] == $ expectedFilter ['request_var ' ]) {
164
+ $ found = true ;
165
+ break ;
166
+ }
167
+ }
168
+ if (!$ found ) {
169
+ $ this ->fail ($ message );
170
+ }
171
+ }
157
172
}
158
173
159
174
/**
You can’t perform that action at this time.
0 commit comments