11
11
use Magento \Bundle \Model \Product \Type ;
12
12
use Magento \Bundle \Model \ResourceModel \BundleFactory ;
13
13
use Magento \Bundle \Model \ResourceModel \Option \Collection ;
14
- use Magento \CatalogRule \Model \ResourceModel \Product \CollectionProcessor ;
15
14
use Magento \Bundle \Model \ResourceModel \Selection \Collection as SelectionCollection ;
16
15
use Magento \Bundle \Model \ResourceModel \Selection \CollectionFactory ;
17
16
use Magento \Bundle \Model \Selection ;
28
27
use Magento \CatalogInventory \Api \StockStateInterface ;
29
28
use Magento \CatalogInventory \Model \StockRegistry ;
30
29
use Magento \CatalogInventory \Model \StockState ;
30
+ use Magento \CatalogRule \Model \ResourceModel \Product \CollectionProcessor ;
31
31
use Magento \Framework \DataObject ;
32
32
use Magento \Framework \EntityManager \EntityMetadataInterface ;
33
33
use Magento \Framework \EntityManager \MetadataPool ;
@@ -1548,6 +1548,10 @@ public function testPrepareForCartAdvancedSpecifyProductOptions()
1548
1548
->disableOriginalConstructor ()
1549
1549
->getMock ();
1550
1550
1551
+ $ buyRequest ->method ('getOptions ' )
1552
+ ->willReturn ([333 => ['type ' => 'image/jpeg ' ]]);
1553
+ $ option ->method ('getId ' )
1554
+ ->willReturn (333 );
1551
1555
$ this ->parentClass ($ group , $ option , $ buyRequest , $ product );
1552
1556
1553
1557
$ product ->expects ($ this ->any ())
@@ -1556,6 +1560,8 @@ public function testPrepareForCartAdvancedSpecifyProductOptions()
1556
1560
$ buyRequest ->expects ($ this ->once ())
1557
1561
->method ('getBundleOption ' )
1558
1562
->willReturn ([0 , '' , 'str ' ]);
1563
+ $ group ->expects ($ this ->once ())
1564
+ ->method ('validateUserValue ' );
1559
1565
1560
1566
$ result = $ this ->model ->prepareForCartAdvanced ($ buyRequest , $ product );
1561
1567
$ this ->assertEquals ('Please specify product option(s). ' , $ result );
0 commit comments