13
13
use Magento \TestFramework \TestCase \AbstractController ;
14
14
use Magento \Customer \Model \Session ;
15
15
use Magento \Customer \Model \Visitor ;
16
- use Laminas \Stdlib \Parameters ;
16
+ use Laminas \Stdlib \ParametersFactory ;
17
17
18
18
/**
19
19
* Test compare product.
@@ -36,7 +36,7 @@ class CompareTest extends AbstractController
36
36
/** @var Visitor */
37
37
private $ visitor ;
38
38
39
- /** @var Parameters */
39
+ /** @var ParametersFactory */
40
40
private $ parameters ;
41
41
42
42
/**
@@ -50,7 +50,7 @@ protected function setUp(): void
50
50
$ this ->productRepository = $ this ->_objectManager ->get (ProductRepository::class);
51
51
$ this ->customerSession = $ this ->_objectManager ->get (Session::class);
52
52
$ this ->visitor = $ this ->_objectManager ->get (Visitor::class);
53
- $ this ->parameters = $ this ->_objectManager ->get (Parameters ::class);
53
+ $ this ->parameters = $ this ->_objectManager ->get (ParametersFactory ::class);
54
54
}
55
55
56
56
/**
@@ -273,7 +273,7 @@ public function testAddNotExistingProductToCompareList(): void
273
273
$ this ->getRequest ()->setMethod (HttpRequest::METHOD_POST );
274
274
$ this ->getRequest ()->setParams (['product ' => 787586534 ]);
275
275
$ this ->dispatch ('catalog/product_compare/add/ ' );
276
- $ this ->assertSessionMessages ($ this ->isEmpty (), MessageInterface:: TYPE_ERROR );
276
+ $ this ->assertSessionMessages ($ this ->isEmpty ());
277
277
$ this ->_assertCompareListEquals ([]);
278
278
$ this ->assertRedirect ($ this ->stringContains ('not_existing ' ));
279
279
}
@@ -285,8 +285,9 @@ public function testAddNotExistingProductToCompareList(): void
285
285
*/
286
286
private function prepareReferer (): void
287
287
{
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 );
290
291
}
291
292
292
293
/**
0 commit comments