Skip to content

Commit 40442d4

Browse files
committed
fixed unit tests
1 parent 30b705e commit 40442d4

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -230,46 +230,6 @@ public function testAddProductCategoriesFilter()
230230
$this->collection->addCategoriesFilter([$conditionType => $values]);
231231
}
232232

233-
public function testAddMediaGalleryData()
234-
{
235-
$attributeId = 42;
236-
$rowId = 4;
237-
$linkField = 'row_id';
238-
$mediaGalleriesMock = [[$linkField => $rowId]];
239-
$itemMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
240-
->disableOriginalConstructor()
241-
->setMethods(['getOrigData'])
242-
->getMock();
243-
$attributeMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class)
244-
->disableOriginalConstructor()
245-
->getMock();
246-
$selectMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class)
247-
->disableOriginalConstructor()
248-
->getMock();
249-
$metadataMock = $this->getMockBuilder(\Magento\Framework\EntityManager\EntityMetadataInterface::class)
250-
->disableOriginalConstructor()
251-
->getMock();
252-
$this->collection->addItem($itemMock);
253-
$this->galleryResourceMock->expects($this->once())->method('createBatchBaseSelect')->willReturn($selectMock);
254-
$attributeMock->expects($this->once())->method('getAttributeId')->willReturn($attributeId);
255-
$this->entityMock->expects($this->once())->method('getAttribute')->willReturn($attributeMock);
256-
$itemMock->expects($this->atLeastOnce())->method('getOrigData')->willReturn($rowId);
257-
$selectMock->expects($this->once())->method('reset')->with(Select::ORDER)->willReturnSelf();
258-
$selectMock->expects($this->once())->method('where')->with('entity.' . $linkField . ' IN (?)', [$rowId])
259-
->willReturnSelf();
260-
$this->metadataPoolMock->expects($this->once())->method('getMetadata')->willReturn($metadataMock);
261-
$metadataMock->expects($this->once())->method('getLinkField')->willReturn($linkField);
262-
263-
$this->connectionMock->expects($this->once())->method('fetchOne')->with($selectMock)->willReturn(42);
264-
$this->connectionMock->expects($this->once())->method('fetchAll')->with($selectMock)->willReturn(
265-
[['row_id' => $rowId]]
266-
);
267-
$this->galleryReadHandlerMock->expects($this->once())->method('addMediaDataToProduct')
268-
->with($itemMock, $mediaGalleriesMock);
269-
270-
$this->assertSame($this->collection, $this->collection->addMediaGalleryData());
271-
}
272-
273233
/**
274234
* Test addTierPriceDataByGroupId method.
275235
*

app/code/Magento/Store/Test/Unit/Model/HeaderProvider/UpgradeInsecureTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UpgradeInsecureTest extends \PHPUnit\Framework\TestCase
1919
/**
2020
* Content-Security-Policy header value
2121
*/
22-
const HEADER_VALUE = 'upgrade-insecure-requests;';
22+
const HEADER_VALUE = 'upgrade-insecure-requests';
2323

2424
/**
2525
* @var UpgradeInsecure

0 commit comments

Comments
 (0)