Skip to content

Commit 053c01f

Browse files
committed
MQE-406: Omitting defaultValue for actionGroup argument causes error
- resolve conflicts
1 parent 10f1683 commit 053c01f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\FunctionalTestingFramework\Test\Objects;
88

9+
use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException;
910
use Magento\FunctionalTestingFramework\Test\Util\ActionMergeUtil;
1011

1112
/**
@@ -65,12 +66,23 @@ public function __construct($name, $arguments, $actions)
6566
* @param array $arguments
6667
* @param string $actionReferenceKey
6768
* @return array
69+
* @throws TestReferenceException
6870
*/
6971
public function getSteps($arguments, $actionReferenceKey)
7072
{
7173
$mergeUtil = new ActionMergeUtil($this->name, "ActionGroup");
7274
$args = $this->arguments;
73-
75+
$emptyArguments = array_keys($args, null, true);
76+
if (!empty($emptyArguments) && $arguments !== null) {
77+
$diff = array_diff($emptyArguments, array_keys($arguments));
78+
if (!empty($diff)) {
79+
$error = 'Argument(s) missed (' . implode(", ", $diff) . ') for actionGroup "' . $this->name . '"';
80+
throw new TestReferenceException($error);
81+
}
82+
} elseif (!empty($emptyArguments)) {
83+
$error = 'Not enough arguments given for actionGroup "' . $this->name . '"';
84+
throw new TestReferenceException($error);
85+
}
7486
if ($arguments) {
7587
$args = array_merge($args, $arguments);
7688
}

0 commit comments

Comments
 (0)