Skip to content

Commit 4126d27

Browse files
MAGETWO-91540: REST API extension_attributes for configurable products is empty when using search criteria on products
- Fix unit tests
1 parent 0d6e11b commit 4126d27

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
2929
use Magento\Framework\Api\SearchCriteriaBuilder;
3030
use Magento\Framework\DB\Adapter\ConnectionException;
31-
use Magento\Framework\EntityManager\Operation\Read\ReadExtensions;
3231
use Magento\Framework\Filesystem;
3332
use Magento\Framework\Serialize\Serializer\Json;
3433
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
@@ -180,11 +179,6 @@ class ProductRepositoryTest extends \PHPUnit\Framework\TestCase
180179
*/
181180
private $cacheLimit = 2;
182181

183-
/**
184-
* @var ReadExtensions|\PHPUnit_Framework_MockObject_MockObject
185-
*/
186-
private $readExtensionsMock;
187-
188182
/**
189183
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
190184
*/
@@ -298,8 +292,6 @@ function ($value) {
298292
}
299293
)
300294
);
301-
$this->readExtensionsMock = $this->getMockBuilder(ReadExtensions::class)
302-
->disableOriginalConstructor()->getMock();
303295

304296
$this->model = $this->objectManager->getObject(
305297
ProductRepository::class,
@@ -323,8 +315,7 @@ function ($value) {
323315
'mediaGalleryProcessor' => $this->mediaGalleryProcessor,
324316
'collectionProcessor' => $this->collectionProcessor,
325317
'serializer' => $this->serializerMock,
326-
'cacheLimit' => $this->cacheLimit,
327-
'readExtensions' => $this->readExtensionsMock,
318+
'cacheLimit' => $this->cacheLimit
328319
]
329320
);
330321
}
@@ -777,8 +768,6 @@ public function testGetList()
777768
$collectionMock->expects($this->once())->method('load');
778769
$collectionMock->expects($this->once())->method('addCategoryIds');
779770
$collectionMock->expects($this->atLeastOnce())->method('getItems')->willReturn([$this->product]);
780-
$this->readExtensionsMock->expects($this->once())->method('execute')->with($this->product);
781-
$collectionMock->expects($this->atLeastOnce())->method('getItems')->willReturn([$this->product]);
782771
$collectionMock->expects($this->once())->method('getSize')->willReturn(128);
783772
$searchResultsMock = $this->createMock(\Magento\Catalog\Api\Data\ProductSearchResultsInterface::class);
784773
$searchResultsMock->expects($this->once())->method('setSearchCriteria')->with($searchCriteriaMock);

0 commit comments

Comments
 (0)