Skip to content

Commit 14488ce

Browse files
Merge remote-tracking branch 'jackalopes/MAGETWO-71024-unskip-unit-tests' into BundledPR-Sep8
2 parents 2bd4d5a + 1cead82 commit 14488ce

File tree

28 files changed

+219
-205
lines changed

28 files changed

+219
-205
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ protected function setUp()
193193
'validate',
194194
'save',
195195
'getMediaGalleryEntries',
196-
'setData',
197-
'getStoreId'
198-
]);
196+
]
197+
);
199198
$this->initializedProductMock->expects($this->any())
200199
->method('hasGalleryAttribute')
201200
->willReturn(true);
@@ -974,7 +973,6 @@ public function saveExistingWithOptionsDataProvider()
974973
*/
975974
public function testSaveWithLinks(array $newLinks, array $existingLinks, array $expectedData)
976975
{
977-
$this->markTestSkipped('Test needs to be refactored.');
978976
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
979977
$this->resourceModelMock->expects($this->any())->method('getIdBySku')->will($this->returnValue(100));
980978
$this->productFactoryMock->expects($this->any())
@@ -1022,7 +1020,7 @@ public function testSaveWithLinks(array $newLinks, array $existingLinks, array $
10221020

10231021
$this->productData['product_links'] = [];
10241022

1025-
$this->initializedProductMock->setData("ignore_links_flag", true);
1023+
$this->initializedProductMock->setData('ignore_links_flag', true);
10261024
$this->initializedProductMock->expects($this->never())
10271025
->method('getProductLinks')
10281026
->willReturn([]);
@@ -1157,7 +1155,6 @@ protected function setupProductMocksForSave()
11571155

11581156
public function testSaveExistingWithNewMediaGalleryEntries()
11591157
{
1160-
$this->markTestSkipped('Test needs to be refactored.');
11611158
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
11621159
$newEntriesData = [
11631160
'images' => [
@@ -1287,7 +1284,6 @@ public function testSaveWithDifferentWebsites()
12871284

12881285
public function testSaveExistingWithMediaGalleryEntries()
12891286
{
1290-
$this->markTestSkipped('Test needs to be refactored.');
12911287
$this->storeManagerMock->expects($this->any())->method('getWebsites')->willReturn([1 => 'default']);
12921288
//update one entry, delete one entry
12931289
$newEntries = [

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/VirtualTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ class VirtualTest extends \PHPUnit\Framework\TestCase
1313
*/
1414
public function testPrepareAttributesWithDefaultValueForSave()
1515
{
16-
$this->markTestSkipped('Test needs to be refactored.');
17-
$virtualModelMock = $this->createMock(\Magento\CatalogImportExport\Model\Import\Product\Type\Virtual::class);
16+
$virtualModelMock = $this->createPartialMock(
17+
\Magento\CatalogImportExport\Model\Import\Product\Type\Virtual::class,
18+
[]
19+
);
1820

1921
$this->setPropertyValue(
2022
$virtualModelMock,
@@ -64,7 +66,7 @@ public function testPrepareAttributesWithDefaultValueForSave()
6466
];
6567

6668
$result = $virtualModelMock->prepareAttributesWithDefaultValueForSave($rowData);
67-
$this->assertEquals($result, $expectedResult);
69+
$this->assertEquals($expectedResult, $result);
6870
}
6971

7072
/**

app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
namespace Magento\CatalogWidget\Test\Unit\Model\Rule\Condition;
87

98
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
@@ -29,11 +28,11 @@ protected function setUp()
2928

3029
$eavConfig = $this->createMock(\Magento\Eav\Model\Config::class);
3130
$this->attributeMock = $this->createMock(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class);
32-
$eavConfig->expects($this->once())->method('getAttribute')->willReturn($this->attributeMock);
31+
$eavConfig->expects($this->any())->method('getAttribute')->willReturn($this->attributeMock);
3332
$ruleMock = $this->createMock(\Magento\SalesRule\Model\Rule::class);
3433
$storeManager = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
3534
$storeMock = $this->createMock(\Magento\Store\Api\Data\StoreInterface::class);
36-
$storeManager->expects($this->once())->method('getStore')->willReturn($storeMock);
35+
$storeManager->expects($this->any())->method('getStore')->willReturn($storeMock);
3736
$productResource = $this->createMock(\Magento\Catalog\Model\ResourceModel\Product::class);
3837
$productResource->expects($this->once())->method('loadAllAttributes')->willReturnSelf();
3938
$productResource->expects($this->once())->method('getAttributesByCode')->willReturn([]);
@@ -73,7 +72,6 @@ public function testAddToCollection()
7372

7473
public function testGetMappedSqlFieldSku()
7574
{
76-
$this->markTestSkipped('Test needs to be refactored.');
7775
$this->model->setAttribute('sku');
7876
$this->assertEquals('e.sku', $this->model->getMappedSqlField());
7977
}

0 commit comments

Comments
 (0)