Skip to content

Commit

Permalink
Fix bug 26449: Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tna274 committed Mar 22, 2020
1 parent 3b6b038 commit 1efecdf
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ public function testBeforeSaveConfigurable()
/** @var \Magento\Catalog\Model\ResourceModel\Product|\PHPUnit_Framework_MockObject_MockObject $subject */
$subject = $this->createMock(\Magento\Catalog\Model\ResourceModel\Product::class);
/** @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject $object */
$object = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['getTypeId', 'getTypeInstance']);
$object = $this->createPartialMock(
\Magento\Catalog\Model\Product::class,
[
'getTypeId',
'getTypeInstance',
'getExtensionAttributes',
'setData'
]
);
$type = $this->createPartialMock(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable::class,
['getSetAttributes']
Expand All @@ -61,7 +69,8 @@ public function testBeforeSaveConfigurable()

$object->expects($this->once())->method('getTypeId')->will($this->returnValue(Configurable::TYPE_CODE));
$object->expects($this->once())->method('getTypeInstance')->will($this->returnValue($type));
$object->expects($this->once())->method('resetConfigurableOptionsData')->with($object);
$object->expects($this->any())->method('getExtensionAttributes');
$object->expects($this->any())->method('setData');

$this->model->beforeSave(
$subject,
Expand Down

0 comments on commit 1efecdf

Please sign in to comment.