@@ -40,12 +40,29 @@ protected function setUp(): void
40
40
41
41
public function testSaveSelectionPrice ()
42
42
{
43
- $ item = new Selection (
44
- $ this ->createMock (\Magento \Framework \Model \Context::class),
45
- $ this ->createMock (\Magento \Framework \Registry::class),
46
- $ this ->createMock (\Magento \Catalog \Helper \Data::class),
47
- $ this ->createMock (\Magento \Bundle \Model \ResourceModel \Selection::class)
48
- );
43
+ $ item = $ this ->getMockBuilder (Selection::class)
44
+ ->disableOriginalConstructor ()
45
+ ->addMethods ([
46
+ 'getSelectionId ' ,
47
+ 'getWebsiteId ' ,
48
+ 'getSelectionPriceType ' ,
49
+ 'getSelectionPriceValue ' ,
50
+ 'getParentProductId ' ,
51
+ 'getDefaultPriceScope ' ])
52
+ ->getMock ();
53
+ $ values = [
54
+ 'selection_id ' => 1 ,
55
+ 'website_id ' => 1 ,
56
+ 'selection_price_type ' => null ,
57
+ 'selection_price_value ' => null ,
58
+ 'parent_product_id ' => 1 ,
59
+ ];
60
+ $ item ->expects ($ this ->once ())->method ('getDefaultPriceScope ' )->willReturn (false );
61
+ $ item ->expects ($ this ->once ())->method ('getSelectionId ' )->willReturn ($ values ['selection_id ' ]);
62
+ $ item ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ values ['website_id ' ]);
63
+ $ item ->expects ($ this ->once ())->method ('getSelectionPriceType ' )->willReturn ($ values ['selection_price_type ' ]);
64
+ $ item ->expects ($ this ->once ())->method ('getSelectionPriceValue ' )->willReturn ($ values ['selection_price_value ' ]);
65
+ $ item ->expects ($ this ->once ())->method ('getParentProductId ' )->willReturn ($ values ['parent_product_id ' ]);
49
66
50
67
$ connection = $ this ->createMock (AdapterInterface::class);
51
68
$ connection ->expects ($ this ->once ())
0 commit comments