Skip to content

Commit b0c261e

Browse files
authored
Merge pull request #118 from magento-commerce/imported-magento-magento2-functional-testing-framework-872
[Imported] AC-1193: Fix broken MFTF tests
2 parents 2a3bd28 + 9110451 commit b0c261e

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

dev/tests/unit/Util/EntityDataObjectBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class EntityDataObjectBuilder
1818
"name" => "Hopper",
1919
"gpa" => "3.5678",
2020
"phone" => "5555555",
21-
"isprimary" => "true"
21+
"isprimary" => "true",
22+
"empty_string" => ""
2223
];
2324

2425
/**

dev/tests/unit/Util/OperationElementBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class OperationElementBuilder
2020
'name' => 'string',
2121
'gpa' => 'number',
2222
'phone' => 'integer',
23-
'isPrimary' => 'boolean'
23+
'isPrimary' => 'boolean',
24+
'empty_string' => 'string'
2425
];
2526

2627
/**

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ private function resolvePrimitiveReferenceElement($entityObject, $operationEleme
403403
// If data was defined at all, attempt to put it into operation data array
404404
// If data was not defined, and element is required, throw exception
405405
// If no data is defined, don't input defaults per primitive into operation data array
406-
if ($elementData !== null) {
406+
if ($elementData !== null && $elementData !== '') {
407407
if (array_key_exists($operationElement->getKey(), $entityObject->getUniquenessData())) {
408408
$uniqueData = $entityObject->getUniquenessDataByName($operationElement->getKey());
409409
if ($uniqueData === 'suffix') {

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,7 @@ private function addUniquenessFunctionCall($input, $wrapWithDoubleQuotes = true)
19481948
*/
19491949
private function wrapWithDoubleQuotes($input)
19501950
{
1951-
if ($input === null) {
1951+
if ($input === null || $input === '') {
19521952
return '';
19531953
}
19541954
//Only replace " with \" so that it doesn't break outer string.

0 commit comments

Comments
 (0)