File tree Expand file tree Collapse file tree 1 file changed +30
-2
lines changed
app/code/Magento/Review/Test/Unit/Block Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2015 Adobe
4+ * All Rights Reserved .
55 */
66declare (strict_types=1 );
77
@@ -129,6 +129,34 @@ public function testGetProductInfo()
129129 $ this ->assertSame ($ productMock , $ this ->object ->getProductInfo ());
130130 }
131131
132+ public function testGetProductInfoNonIntParam ()
133+ {
134+ $ productId = 3 ;
135+ $ productIdNonInt = "3abc " ;
136+ $ storeId = 1 ;
137+
138+ $ this ->storeManager ->expects (
139+ $ this ->any ()
140+ )->method (
141+ 'getStore '
142+ )->willReturn (
143+ new DataObject (['id ' => $ storeId ])
144+ );
145+
146+ $ this ->requestMock ->expects ($ this ->once ())
147+ ->method ('getParam ' )
148+ ->with ('id ' , false )
149+ ->willReturn ($ productIdNonInt );
150+
151+ $ productMock = $ this ->getMockForAbstractClass (ProductInterface::class);
152+ $ this ->productRepository ->expects ($ this ->once ())
153+ ->method ('getById ' )
154+ ->with ($ productId , false , $ storeId )
155+ ->willReturn ($ productMock );
156+
157+ $ this ->assertSame ($ productMock , $ this ->object ->getProductInfo ());
158+ }
159+
132160 /**
133161 * @param bool $isSecure
134162 * @param string $actionUrl
You can’t perform that action at this time.
0 commit comments