Skip to content

Commit a344d34

Browse files
committed
MQE-588: CreatedData should throw Error/Warning when undefined data is returned
- prevent printing in unit phase
1 parent d4a1237 commit a344d34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/PersistedObjectHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1111
use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException;
1212
use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil;
13+
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
1314

1415
class PersistedObjectHandler
1516
{
@@ -188,7 +189,9 @@ public function retrieveEntityField($stepKey, $field, $scope)
188189
$warnMsg .= "Please fix the invalid reference. This will result in fatal error in next major release.";
189190
//TODO: change this to throw an exception in next major release
190191
LoggingUtil::getInstance()->getLogger(PersistedObjectHandler::class)->warn($warnMsg);
191-
print($warnMsg . PHP_EOL);
192+
if (MftfApplicationConfig::getConfig()->getPhase() !== MftfApplicationConfig::UNIT_TEST_PHASE) {
193+
print("\n$warnMsg\n");
194+
}
192195
}
193196
return $fieldValue;
194197
}

0 commit comments

Comments
 (0)