@@ -44,7 +44,10 @@ public function testAddAction()
4444 )
4545 );
4646
47- $ this ->assertSessionMessages ($ this ->contains ('Simple Product 1 Name ' ), MessageInterface::TYPE_SUCCESS );
47+ $ this ->assertSessionMessages (
48+ $ this ->equalTo (['You added product Simple Product 1 Name to the comparison list. ' ]),
49+ MessageInterface::TYPE_SUCCESS
50+ );
4851
4952 $ this ->assertRedirect ();
5053
@@ -68,7 +71,10 @@ public function testRemoveAction()
6871 $ product = $ this ->productRepository ->get ('simple_product_2 ' );
6972 $ this ->dispatch ('catalog/product_compare/remove/product/ ' . $ product ->getEntityId ());
7073
71- $ this ->assertSessionMessages ($ this ->contains ('Simple Product 2 Name ' ), MessageInterface::TYPE_SUCCESS );
74+ $ this ->assertSessionMessages (
75+ $ this ->equalTo (['You removed product Simple Product 2 Name from the comparison list. ' ]),
76+ MessageInterface::TYPE_SUCCESS
77+ );
7278
7379 $ this ->assertRedirect ();
7480 $ restProduct = $ this ->productRepository ->get ('simple_product_1 ' );
@@ -82,7 +88,10 @@ public function testRemoveActionWithSession()
8288 $ this ->dispatch ('catalog/product_compare/remove/product/ ' . $ product ->getEntityId ());
8389 $ secondProduct = $ this ->productRepository ->get ('simple_product_2 ' );
8490
85- $ this ->assertSessionMessages ($ this ->contains ('Simple Product 1 Name ' ), MessageInterface::TYPE_SUCCESS );
91+ $ this ->assertSessionMessages (
92+ $ this ->equalTo (['You removed product Simple Product 1 Name from the comparison list. ' ]),
93+ MessageInterface::TYPE_SUCCESS
94+ );
8695
8796 $ this ->assertRedirect ();
8897
@@ -122,7 +131,7 @@ public function testClearAction()
122131 $ this ->dispatch ('catalog/product_compare/clear ' );
123132
124133 $ this ->assertSessionMessages (
125- $ this ->contains ( 'You cleared the comparison list. ' ),
134+ $ this ->equalTo ([ 'You cleared the comparison list. ' ]),
126135 MessageInterface::TYPE_SUCCESS
127136 );
128137
@@ -141,10 +150,9 @@ public function testRemoveActionProductNameXss()
141150 $ this ->dispatch ('catalog/product_compare/remove/product/ ' . $ product ->getEntityId () . '?nocookie=1 ' );
142151
143152 $ this ->assertSessionMessages (
144- $ this ->logicalNot ($ this ->contains ('<script>alert("xss");</script> ' ))
145- );
146- $ this ->assertSessionMessages (
147- $ this ->contains ('<script>alert("xss");</script> ' ),
153+ $ this ->equalTo (
154+ ['You removed product <script>alert("xss");</script> from the comparison list. ' ]
155+ ),
148156 MessageInterface::TYPE_SUCCESS
149157 );
150158 }
0 commit comments