Skip to content

Commit 59c1bc6

Browse files
author
Munkh-Ulzii Balidar
committed
29251 update unit test belongs to change
1 parent c40f065 commit 59c1bc6

File tree

1 file changed

+12
-2
lines changed
  • app/code/Magento/ConfigurableProduct/Test/Unit/Helper

1 file changed

+12
-2
lines changed

app/code/Magento/ConfigurableProduct/Test/Unit/Helper/DataTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function setUp(): void
4949
->getMock();
5050
$this->_imageHelperMock = $this->createMock(Image::class);
5151
$this->_productMock = $this->createMock(Product::class);
52-
52+
$this->_productMock->setTypeId(Configurable::TYPE_CODE);
5353
$this->_model = $objectManager->getObject(
5454
Data::class,
5555
[
@@ -66,6 +66,10 @@ public function testGetAllowAttributes()
6666
->method('getConfigurableAttributes')
6767
->with($this->_productMock);
6868

69+
$this->_productMock->expects($this->once())
70+
->method('getTypeId')
71+
->willReturn(Configurable::TYPE_CODE);
72+
6973
$this->_productMock->expects($this->once())
7074
->method('getTypeInstance')
7175
->willReturn($typeInstanceMock);
@@ -119,7 +123,10 @@ public function getOptionsDataProvider()
119123
{
120124
$currentProductMock = $this->createPartialMock(
121125
Product::class,
122-
['getTypeInstance']
126+
[
127+
'getTypeInstance',
128+
'getTypeId'
129+
]
123130
);
124131
$provider = [];
125132
$provider[] = [
@@ -156,6 +163,9 @@ public function getOptionsDataProvider()
156163
$typeInstanceMock->expects($this->any())
157164
->method('getConfigurableAttributes')
158165
->willReturn($attributes);
166+
$currentProductMock->expects($this->any())
167+
->method('getTypeId')
168+
->willReturn(Configurable::TYPE_CODE);
159169
$currentProductMock->expects($this->any())
160170
->method('getTypeInstance')
161171
->willReturn($typeInstanceMock);

0 commit comments

Comments
 (0)