@@ -44,7 +44,10 @@ public function testAddAction()
44
44
)
45
45
);
46
46
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
+ );
48
51
49
52
$ this ->assertRedirect ();
50
53
@@ -68,7 +71,10 @@ public function testRemoveAction()
68
71
$ product = $ this ->productRepository ->get ('simple_product_2 ' );
69
72
$ this ->dispatch ('catalog/product_compare/remove/product/ ' . $ product ->getEntityId ());
70
73
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
+ );
72
78
73
79
$ this ->assertRedirect ();
74
80
$ restProduct = $ this ->productRepository ->get ('simple_product_1 ' );
@@ -82,7 +88,10 @@ public function testRemoveActionWithSession()
82
88
$ this ->dispatch ('catalog/product_compare/remove/product/ ' . $ product ->getEntityId ());
83
89
$ secondProduct = $ this ->productRepository ->get ('simple_product_2 ' );
84
90
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
+ );
86
95
87
96
$ this ->assertRedirect ();
88
97
@@ -122,7 +131,7 @@ public function testClearAction()
122
131
$ this ->dispatch ('catalog/product_compare/clear ' );
123
132
124
133
$ this ->assertSessionMessages (
125
- $ this ->contains ( 'You cleared the comparison list. ' ),
134
+ $ this ->equalTo ([ 'You cleared the comparison list. ' ]),
126
135
MessageInterface::TYPE_SUCCESS
127
136
);
128
137
@@ -141,10 +150,9 @@ public function testRemoveActionProductNameXss()
141
150
$ this ->dispatch ('catalog/product_compare/remove/product/ ' . $ product ->getEntityId () . '?nocookie=1 ' );
142
151
143
152
$ 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
+ ),
148
156
MessageInterface::TYPE_SUCCESS
149
157
);
150
158
}
0 commit comments