@@ -38,7 +38,8 @@ public function testExecuteNonExistingSearchKey() : void
38
38
->setPostValue ('limit ' , 50 );
39
39
$ this ->dispatch ('backend/catalog/product/search ' );
40
40
$ responseBody = $ this ->getResponse ()->getBody ();
41
- $ this ->assertContains ('{"options":[],"total":0} ' , $ responseBody );
41
+ $ jsonResponse = json_decode ($ responseBody );
42
+ $ this ->assertEmpty ($ jsonResponse ['options ' ]);
42
43
}
43
44
44
45
/**
@@ -57,7 +58,8 @@ public function testExecuteNotVisibleIndividuallyProducts() : void
57
58
->setPostValue ('limit ' , 50 );
58
59
$ this ->dispatch ('backend/catalog/product/search ' );
59
60
$ responseBody = $ this ->getResponse ()->getBody ();
60
- $ this ->assertContains ('"total":1} ' , $ responseBody );
61
+ $ jsonResponse = json_decode ($ responseBody );
62
+ $ this ->assertEquals (1 , $ jsonResponse ['total ' ]);
61
63
}
62
64
63
65
/**
@@ -71,6 +73,7 @@ public function testExecuteEnabledAndDisabledProducts() : void
71
73
->setPostValue ('limit ' , 50 );
72
74
$ this ->dispatch ('backend/catalog/product/search ' );
73
75
$ responseBody = $ this ->getResponse ()->getBody ();
74
- $ this ->assertContains ('"total":3} ' , $ responseBody );
76
+ $ jsonResponse = json_decode ($ responseBody );
77
+ $ this ->assertEquals (7 , $ jsonResponse ['total ' ]);
75
78
}
76
79
}
0 commit comments