Skip to content

Commit 4a59bdd

Browse files
authored
LYNX-45: Introducing purchase order rule data fixtures
1 parent 0fd1bf8 commit 4a59bdd

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

app/code/Magento/Customer/Test/Fixture/Customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Customer implements RevertibleDataFixtureInterface
2929
{
3030
private const DEFAULT_DATA = [
31-
'password' => null,
31+
'password' => 'password',
3232
CustomerInterface::ID => null,
3333
CustomerInterface::CONFIRMATION => null,
3434
CustomerInterface::CREATED_AT => null,

dev/tests/integration/framework/Magento/TestFramework/Fixture/Api/DataMerger.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,11 @@ class DataMerger
2727
public function merge(array $defaultData, array $data, bool $isExtensible = true): array
2828
{
2929
if ($isExtensible) {
30-
if (!isset($data[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY])) {
31-
$data[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY] = [];
30+
if (isset($data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES])) {
31+
$data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES] = $this->convertCustomAttributesToMap(
32+
$data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]
33+
);
3234
}
33-
if (!isset($data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES])) {
34-
$data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES] = [];
35-
}
36-
$data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES] = $this->convertCustomAttributesToMap(
37-
$data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]
38-
);
3935
foreach ($data as $key => $value) {
4036
if (!array_key_exists($key, $defaultData)) {
4137
if (array_key_exists($key, $defaultData[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY])) {
@@ -50,7 +46,7 @@ public function merge(array $defaultData, array $data, bool $isExtensible = true
5046

5147
$result = $this->mergeRecursive($defaultData, $data);
5248

53-
if ($isExtensible) {
49+
if ($isExtensible && isset($result[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES])) {
5450
$result[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES] = $this->convertCustomAttributesToCollection(
5551
$result[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]
5652
);

0 commit comments

Comments
 (0)