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 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2015 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
@@ -129,6 +129,34 @@ public function testGetProductInfo()
129
129
$ this ->assertSame ($ productMock , $ this ->object ->getProductInfo ());
130
130
}
131
131
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
+
132
160
/**
133
161
* @param bool $isSecure
134
162
* @param string $actionUrl
You can’t perform that action at this time.
0 commit comments