1313use Magento \TestFramework \TestCase \AbstractController ;
1414use Magento \Customer \Model \Session ;
1515use Magento \Customer \Model \Visitor ;
16- use Laminas \Stdlib \Parameters ;
16+ use Laminas \Stdlib \ParametersFactory ;
1717
1818/**
1919 * Test compare product.
@@ -36,7 +36,7 @@ class CompareTest extends AbstractController
3636 /** @var Visitor */
3737 private $ visitor ;
3838
39- /** @var Parameters */
39+ /** @var ParametersFactory */
4040 private $ parameters ;
4141
4242 /**
@@ -50,7 +50,7 @@ protected function setUp(): void
5050 $ this ->productRepository = $ this ->_objectManager ->get (ProductRepository::class);
5151 $ this ->customerSession = $ this ->_objectManager ->get (Session::class);
5252 $ this ->visitor = $ this ->_objectManager ->get (Visitor::class);
53- $ this ->parameters = $ this ->_objectManager ->get (Parameters ::class);
53+ $ this ->parameters = $ this ->_objectManager ->get (ParametersFactory ::class);
5454 }
5555
5656 /**
@@ -273,7 +273,7 @@ public function testAddNotExistingProductToCompareList(): void
273273 $ this ->getRequest ()->setMethod (HttpRequest::METHOD_POST );
274274 $ this ->getRequest ()->setParams (['product ' => 787586534 ]);
275275 $ this ->dispatch ('catalog/product_compare/add/ ' );
276- $ this ->assertSessionMessages ($ this ->isEmpty (), MessageInterface:: TYPE_ERROR );
276+ $ this ->assertSessionMessages ($ this ->isEmpty ());
277277 $ this ->_assertCompareListEquals ([]);
278278 $ this ->assertRedirect ($ this ->stringContains ('not_existing ' ));
279279 }
@@ -285,8 +285,9 @@ public function testAddNotExistingProductToCompareList(): void
285285 */
286286 private function prepareReferer (): void
287287 {
288- $ this ->parameters ->set ('HTTP_REFERER ' , 'http://localhost/not_existing ' );
289- $ this ->getRequest ()->setServer ($ this ->parameters );
288+ $ parameters = $ this ->parameters ->create ();
289+ $ parameters ->set ('HTTP_REFERER ' , 'http://localhost/not_existing ' );
290+ $ this ->getRequest ()->setServer ($ parameters );
290291 }
291292
292293 /**
0 commit comments