File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,10 @@ public function copy(\Magento\Catalog\Model\Product $product)
47
47
$ product ->getWebsiteIds ();
48
48
$ product ->getCategoryIds ();
49
49
50
+ /** @var \Magento\Catalog\Model\Product $duplicate */
50
51
$ duplicate = $ this ->productFactory ->create ();
51
52
$ duplicate ->setData ($ product ->getData ());
53
+ $ duplicate ->setOptions ([]);
52
54
$ duplicate ->setIsDuplicate (true );
53
55
$ duplicate ->setOriginalId ($ product ->getEntityId ());
54
56
$ duplicate ->setStatus (\Magento \Catalog \Model \Product \Attribute \Source \Status::STATUS_DISABLED );
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ public function testCopy()
79
79
[
80
80
'__wakeup ' ,
81
81
'setData ' ,
82
+ 'setOptions ' ,
82
83
'setIsDuplicate ' ,
83
84
'setOriginalId ' ,
84
85
'setStatus ' ,
@@ -97,6 +98,7 @@ public function testCopy()
97
98
);
98
99
$ this ->productFactoryMock ->expects ($ this ->once ())->method ('create ' )->will ($ this ->returnValue ($ duplicateMock ));
99
100
101
+ $ duplicateMock ->expects ($ this ->once ())->method ('setOptions ' )->with ([]);
100
102
$ duplicateMock ->expects ($ this ->once ())->method ('setIsDuplicate ' )->with (true );
101
103
$ duplicateMock ->expects ($ this ->once ())->method ('setOriginalId ' )->with (1 );
102
104
$ duplicateMock ->expects (
You can’t perform that action at this time.
0 commit comments