@@ -1438,11 +1438,13 @@ public function testProductWithWrappedAdditionalAttributes()
1438
1438
* @param bool $expectedResult
1439
1439
* @magentoAppArea adminhtml
1440
1440
* @magentoAppIsolation enabled
1441
+ * @magentoDbIsolation enabled
1442
+ * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
1441
1443
* @dataProvider validateRowDataProvider
1442
1444
*/
1443
1445
public function testValidateRow (array $ row , $ behavior , $ expectedResult )
1444
1446
{
1445
- $ this ->_model ->setParameters (['behavior ' => $ behavior ]);
1447
+ $ this ->_model ->setParameters (['behavior ' => $ behavior, ' entity ' => ' catalog_product ' ]);
1446
1448
$ this ->assertSame ($ expectedResult , $ this ->_model ->validateRow ($ row , 1 ));
1447
1449
}
1448
1450
@@ -1453,18 +1455,18 @@ public function validateRowDataProvider()
1453
1455
{
1454
1456
return [
1455
1457
[
1456
- 'row ' => ['sku ' => '24-MB01 ' ],
1458
+ 'row ' => ['sku ' => 'simple products ' ],
1457
1459
'behavior ' => null ,
1458
1460
'expectedResult ' => true ,
1459
1461
],
1460
1462
[
1461
- 'row ' => ['sku ' => '24-MB01- absent ' ],
1463
+ 'row ' => ['sku ' => 'simple products absent ' ],
1462
1464
'behavior ' => null ,
1463
1465
'expectedResult ' => false ,
1464
1466
],
1465
1467
[
1466
1468
'row ' => [
1467
- 'sku ' => '24-MB01- absent ' ,
1469
+ 'sku ' => 'simple products absent ' ,
1468
1470
'name ' => 'Test ' ,
1469
1471
'product_type ' => 'simple ' ,
1470
1472
'_attribute_set ' => 'Default ' ,
@@ -1474,18 +1476,18 @@ public function validateRowDataProvider()
1474
1476
'expectedResult ' => true ,
1475
1477
],
1476
1478
[
1477
- 'row ' => ['sku ' => '24-MB01 ' ],
1479
+ 'row ' => ['sku ' => 'simple products ' ],
1478
1480
'behavior ' => Import::BEHAVIOR_ADD_UPDATE ,
1479
1481
'expectedResult ' => true ,
1480
1482
],
1481
1483
[
1482
- 'row ' => ['sku ' => '24-MB01- absent ' ],
1484
+ 'row ' => ['sku ' => 'simple products absent ' ],
1483
1485
'behavior ' => Import::BEHAVIOR_ADD_UPDATE ,
1484
1486
'expectedResult ' => false ,
1485
1487
],
1486
1488
[
1487
1489
'row ' => [
1488
- 'sku ' => '24-MB01- absent ' ,
1490
+ 'sku ' => 'simple products absent ' ,
1489
1491
'name ' => 'Test ' ,
1490
1492
'product_type ' => 'simple ' ,
1491
1493
'_attribute_set ' => 'Default ' ,
@@ -1495,25 +1497,47 @@ public function validateRowDataProvider()
1495
1497
'expectedResult ' => true ,
1496
1498
],
1497
1499
[
1498
- 'row ' => ['sku ' => '24-MB01 ' ],
1500
+ 'row ' => ['sku ' => 'simple products ' ],
1499
1501
'behavior ' => Import::BEHAVIOR_DELETE ,
1500
1502
'expectedResult ' => true ,
1501
1503
],
1502
1504
[
1503
- 'row ' => ['sku ' => '24-MB01- absent ' ],
1505
+ 'row ' => ['sku ' => 'simple products absent ' ],
1504
1506
'behavior ' => Import::BEHAVIOR_DELETE ,
1505
1507
'expectedResult ' => false ,
1506
1508
],
1507
1509
[
1508
- 'row ' => ['sku ' => '24-MB01 ' ],
1510
+ 'row ' => ['sku ' => 'simple products ' ],
1511
+ 'behavior ' => Import::BEHAVIOR_REPLACE ,
1512
+ 'expectedResult ' => false ,
1513
+ ],
1514
+ [
1515
+ 'row ' => ['sku ' => 'simple products absent ' ],
1509
1516
'behavior ' => Import::BEHAVIOR_REPLACE ,
1510
1517
'expectedResult ' => false ,
1511
1518
],
1512
1519
[
1513
- 'row ' => ['sku ' => '24-MB01-absent ' ],
1520
+ 'row ' => [
1521
+ 'sku ' => 'simple products absent ' ,
1522
+ 'name ' => 'Test ' ,
1523
+ 'product_type ' => 'simple ' ,
1524
+ '_attribute_set ' => 'Default ' ,
1525
+ 'price ' => 10.20 ,
1526
+ ],
1514
1527
'behavior ' => Import::BEHAVIOR_REPLACE ,
1515
1528
'expectedResult ' => false ,
1516
1529
],
1530
+ [
1531
+ 'row ' => [
1532
+ 'sku ' => 'simple products ' ,
1533
+ 'name ' => 'Test ' ,
1534
+ 'product_type ' => 'simple ' ,
1535
+ '_attribute_set ' => 'Default ' ,
1536
+ 'price ' => 10.20 ,
1537
+ ],
1538
+ 'behavior ' => Import::BEHAVIOR_REPLACE ,
1539
+ 'expectedResult ' => true ,
1540
+ ],
1517
1541
];
1518
1542
}
1519
1543
}
0 commit comments