Skip to content

Commit 0220fb0

Browse files
committed
Merge branch '2.3-develop' of github.com:magento-commerce/magento2ce into MC-40729
2 parents 8e8cc9e + f51dc0d commit 0220fb0

File tree

4 files changed

+311
-285
lines changed

4 files changed

+311
-285
lines changed

app/code/Magento/Customer/Api/Data/CustomerInterface.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
namespace Magento\Customer\Api\Data;
77

88
/**
9-
* Customer interface.
9+
* Customer entity interface for API handling.
10+
*
1011
* @api
1112
* @since 100.0.2
1213
*/
@@ -161,7 +162,10 @@ public function setCreatedIn($createdIn);
161162
/**
162163
* Get date of birth
163164
*
164-
* @return string|null
165+
* @return string|null In keeping with current security and privacy best practices, be sure you are aware of any
166+
* potential legal and security risks associated with the storage of customers’ full date of birth
167+
* (month, day, year) along with other personal identifiers (e.g., full name) before collecting or processing
168+
* such data.
165169
*/
166170
public function getDob();
167171

app/code/Magento/Sales/Api/Data/OrderInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,10 @@ public function setCreatedAt($createdAt);
913913
/**
914914
* Gets the customer date-of-birth (DOB) for the order.
915915
*
916-
* @return string|null Customer date-of-birth (DOB).
916+
* @return string|null In keeping with current security and privacy best practices, be sure you are aware of any
917+
* potential legal and security risks associated with the storage of customers’ full date of birth
918+
* (month, day, year) along with other personal identifiers (e.g., full name) before collecting or processing
919+
* such data.
917920
*/
918921
public function getCustomerDob();
919922

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php

Lines changed: 0 additions & 282 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Magento\Catalog\Model\Product;
1515
use Magento\Catalog\Model\ResourceModel\Product as ProductResource;
1616
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
17-
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
1817
use Magento\CatalogInventory\Model\Stock;
1918
use Magento\CatalogInventory\Model\StockRegistry;
2019
use Magento\CatalogInventory\Model\StockRegistryStorage;
@@ -57,21 +56,6 @@ class ProductTest extends \Magento\TestFramework\Indexer\TestCase
5756
*/
5857
protected $_model;
5958

60-
/**
61-
* @var \Magento\CatalogImportExport\Model\Import\Uploader
62-
*/
63-
protected $_uploader;
64-
65-
/**
66-
* @var \Magento\CatalogImportExport\Model\Import\UploaderFactory
67-
*/
68-
protected $_uploaderFactory;
69-
70-
/**
71-
* @var \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface|\PHPUnit\Framework\MockObject\MockObject
72-
*/
73-
protected $_stockStateProvider;
74-
7559
/**
7660
* @var \Magento\Framework\ObjectManagerInterface
7761
*/
@@ -1230,38 +1214,6 @@ public function testInvalidSkuLink()
12301214
$this->assertArrayNotHasKey("simple2", $products, "Simple Product2 should not have been imported");
12311215
}
12321216

1233-
/**
1234-
* @magentoDataFixture Magento/Catalog/_files/products_with_multiselect_attribute.php
1235-
* @magentoAppIsolation enabled
1236-
* @magentoDbIsolation enabled
1237-
*/
1238-
public function testValidateInvalidMultiselectValues()
1239-
{
1240-
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
1241-
\Magento\Framework\Filesystem::class
1242-
);
1243-
$directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
1244-
$source = $this->objectManager->create(
1245-
\Magento\ImportExport\Model\Import\Source\Csv::class,
1246-
[
1247-
'file' => __DIR__ . '/_files/products_with_invalid_multiselect_values.csv',
1248-
'directory' => $directory
1249-
]
1250-
);
1251-
$errors = $this->_model->setParameters(
1252-
['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product']
1253-
)->setSource(
1254-
$source
1255-
)->validateData();
1256-
1257-
$this->assertTrue($errors->getErrorsCount() == 1);
1258-
$this->assertEquals(
1259-
"Value for 'multiselect_attribute' attribute contains incorrect value, "
1260-
. "see acceptable values on settings specified for Admin",
1261-
$errors->getErrorByRowNumber(1)[0]->getErrorMessage()
1262-
);
1263-
}
1264-
12651217
/**
12661218
* @magentoDataFixture Magento/Catalog/_files/categories.php
12671219
* @magentoDataFixture Magento/Store/_files/website.php
@@ -1598,97 +1550,6 @@ protected function loadCategoryByName($categoryName)
15981550
return $collection->getItemByColumnValue('name', $categoryName);
15991551
}
16001552

1601-
/**
1602-
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
1603-
* @magentoAppIsolation enabled
1604-
* @dataProvider validateUrlKeysDataProvider
1605-
* @param $importFile string
1606-
* @param $expectedErrors array
1607-
* @throws \Magento\Framework\Exception\LocalizedException
1608-
*/
1609-
public function testValidateUrlKeys($importFile, $expectedErrors)
1610-
{
1611-
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
1612-
\Magento\Framework\Filesystem::class
1613-
);
1614-
$directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
1615-
1616-
$source = $this->objectManager->create(
1617-
\Magento\ImportExport\Model\Import\Source\Csv::class,
1618-
[
1619-
'file' => __DIR__ . '/_files/' . $importFile,
1620-
'directory' => $directory
1621-
]
1622-
);
1623-
/** @var \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface $errors */
1624-
$errors = $this->_model->setParameters(
1625-
['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product']
1626-
)->setSource(
1627-
$source
1628-
)->validateData();
1629-
$this->assertEquals(
1630-
$expectedErrors[RowValidatorInterface::ERROR_DUPLICATE_URL_KEY],
1631-
count($errors->getErrorsByCode([RowValidatorInterface::ERROR_DUPLICATE_URL_KEY]))
1632-
);
1633-
}
1634-
1635-
/**
1636-
* @return array
1637-
*/
1638-
public function validateUrlKeysDataProvider()
1639-
{
1640-
return [
1641-
[
1642-
'products_to_check_valid_url_keys.csv',
1643-
[
1644-
RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 0
1645-
]
1646-
],
1647-
[
1648-
'products_to_check_duplicated_url_keys.csv',
1649-
[
1650-
RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 2
1651-
]
1652-
],
1653-
[
1654-
'products_to_check_duplicated_names.csv' ,
1655-
[
1656-
RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 1
1657-
]
1658-
]
1659-
];
1660-
}
1661-
1662-
/**
1663-
* @magentoDataFixture Magento/Store/_files/website.php
1664-
* @magentoDataFixture Magento/Store/_files/core_fixturestore.php
1665-
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
1666-
* @magentoAppIsolation enabled
1667-
* @magentoDbIsolation enabled
1668-
*/
1669-
public function testValidateUrlKeysMultipleStores()
1670-
{
1671-
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
1672-
\Magento\Framework\Filesystem::class
1673-
);
1674-
$directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
1675-
1676-
$source = $this->objectManager->create(
1677-
\Magento\ImportExport\Model\Import\Source\Csv::class,
1678-
[
1679-
'file' => __DIR__ . '/_files/products_to_check_valid_url_keys_multiple_stores.csv',
1680-
'directory' => $directory
1681-
]
1682-
);
1683-
$errors = $this->_model->setParameters(
1684-
['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product']
1685-
)->setSource(
1686-
$source
1687-
)->validateData();
1688-
1689-
$this->assertTrue($errors->getErrorsCount() == 0);
1690-
}
1691-
16921553
/**
16931554
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_with_product_links_data.php
16941555
* @magentoAppArea adminhtml
@@ -2378,149 +2239,6 @@ private function getProductBySku($sku, $store = null)
23782239
return $product;
23792240
}
23802241

2381-
/**
2382-
* @param array $row
2383-
* @param string|null $behavior
2384-
* @param bool $expectedResult
2385-
* @magentoAppArea adminhtml
2386-
* @magentoAppIsolation enabled
2387-
* @magentoDbIsolation enabled
2388-
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php
2389-
* @dataProvider validateRowDataProvider
2390-
*/
2391-
public function testValidateRow(array $row, $behavior, $expectedResult)
2392-
{
2393-
$this->_model->setParameters(['behavior' => $behavior, 'entity' => 'catalog_product']);
2394-
$this->assertSame($expectedResult, $this->_model->validateRow($row, 1));
2395-
}
2396-
2397-
/**
2398-
* @return array
2399-
*/
2400-
public function validateRowDataProvider()
2401-
{
2402-
return [
2403-
[
2404-
'row' => ['sku' => 'simple products'],
2405-
'behavior' => null,
2406-
'expectedResult' => true,
2407-
],
2408-
[
2409-
'row' => ['sku' => 'simple products absent'],
2410-
'behavior' => null,
2411-
'expectedResult' => false,
2412-
],
2413-
[
2414-
'row' => [
2415-
'sku' => 'simple products absent',
2416-
'name' => 'Test',
2417-
'product_type' => 'simple',
2418-
'_attribute_set' => 'Default',
2419-
'price' => 10.20,
2420-
],
2421-
'behavior' => null,
2422-
'expectedResult' => true,
2423-
],
2424-
[
2425-
'row' => ['sku' => 'simple products'],
2426-
'behavior' => Import::BEHAVIOR_ADD_UPDATE,
2427-
'expectedResult' => true,
2428-
],
2429-
[
2430-
'row' => ['sku' => 'simple products absent'],
2431-
'behavior' => Import::BEHAVIOR_ADD_UPDATE,
2432-
'expectedResult' => false,
2433-
],
2434-
[
2435-
'row' => [
2436-
'sku' => 'simple products absent',
2437-
'name' => 'Test',
2438-
'product_type' => 'simple',
2439-
'_attribute_set' => 'Default',
2440-
'price' => 10.20,
2441-
],
2442-
'behavior' => Import::BEHAVIOR_ADD_UPDATE,
2443-
'expectedResult' => true,
2444-
],
2445-
[
2446-
'row' => ['sku' => 'simple products'],
2447-
'behavior' => Import::BEHAVIOR_DELETE,
2448-
'expectedResult' => true,
2449-
],
2450-
[
2451-
'row' => ['sku' => 'simple products absent'],
2452-
'behavior' => Import::BEHAVIOR_DELETE,
2453-
'expectedResult' => false,
2454-
],
2455-
[
2456-
'row' => ['sku' => 'simple products'],
2457-
'behavior' => Import::BEHAVIOR_REPLACE,
2458-
'expectedResult' => false,
2459-
],
2460-
[
2461-
'row' => ['sku' => 'simple products absent'],
2462-
'behavior' => Import::BEHAVIOR_REPLACE,
2463-
'expectedResult' => false,
2464-
],
2465-
[
2466-
'row' => [
2467-
'sku' => 'simple products absent',
2468-
'name' => 'Test',
2469-
'product_type' => 'simple',
2470-
'_attribute_set' => 'Default',
2471-
'price' => 10.20,
2472-
],
2473-
'behavior' => Import::BEHAVIOR_REPLACE,
2474-
'expectedResult' => false,
2475-
],
2476-
[
2477-
'row' => [
2478-
'sku' => 'simple products',
2479-
'name' => 'Test',
2480-
'product_type' => 'simple',
2481-
'_attribute_set' => 'Default',
2482-
'price' => 10.20,
2483-
],
2484-
'behavior' => Import::BEHAVIOR_REPLACE,
2485-
'expectedResult' => true,
2486-
],
2487-
[
2488-
'row' => ['sku' => 'sku with whitespace ',
2489-
'name' => 'Test',
2490-
'product_type' => 'simple',
2491-
'_attribute_set' => 'Default',
2492-
'price' => 10.20,
2493-
],
2494-
'behavior' => Import::BEHAVIOR_ADD_UPDATE,
2495-
'expectedResult' => false,
2496-
],
2497-
];
2498-
}
2499-
2500-
/**
2501-
* @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::_saveValidatedBunches
2502-
*/
2503-
public function testValidateData()
2504-
{
2505-
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
2506-
->create(\Magento\Framework\Filesystem::class);
2507-
$directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
2508-
2509-
$source = $this->objectManager->create(
2510-
\Magento\ImportExport\Model\Import\Source\Csv::class,
2511-
[
2512-
'file' => __DIR__ . '/_files/products_to_import.csv',
2513-
'directory' => $directory
2514-
]
2515-
);
2516-
2517-
$errors = $this->_model->setParameters(
2518-
['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product']
2519-
)->setSource($source)->validateData();
2520-
2521-
$this->assertTrue($errors->getErrorsCount() == 0);
2522-
}
2523-
25242242
/**
25252243
* Tests situation when images for importing products are already present in filesystem.
25262244
*

0 commit comments

Comments
 (0)