6
6
7
7
namespace Magento \FunctionalTestingFramework \Test \Util ;
8
8
9
+ use Magento \FunctionalTestingFramework \Exceptions \TestReferenceException ;
9
10
use Magento \FunctionalTestingFramework \Exceptions \XmlException ;
10
11
use Magento \FunctionalTestingFramework \Test \Handlers \ActionGroupObjectHandler ;
11
12
use Magento \FunctionalTestingFramework \Test \Objects \ActionObject ;
@@ -69,6 +70,7 @@ public function resolveActionSteps($parsedSteps, $skipActionGroupResolution = fa
69
70
* Method to resolve action group references and insert relevant actions into step flow
70
71
*
71
72
* @param array $mergedSteps
73
+ * @throws TestReferenceException
72
74
* @return array
73
75
*/
74
76
private function resolveActionGroups ($ mergedSteps )
@@ -78,9 +80,11 @@ private function resolveActionGroups($mergedSteps)
78
80
foreach ($ mergedSteps as $ key => $ mergedStep ) {
79
81
/**@var ActionObject $mergedStep**/
80
82
if ($ mergedStep ->getType () == ActionObjectExtractor::ACTION_GROUP_TAG ) {
81
- $ actionGroup = ActionGroupObjectHandler::getInstance ()->getObject (
82
- $ mergedStep ->getCustomActionAttributes ()[ActionObjectExtractor::ACTION_GROUP_REF ]
83
- );
83
+ $ actionGroupRef = $ mergedStep ->getCustomActionAttributes ()[ActionObjectExtractor::ACTION_GROUP_REF ];
84
+ $ actionGroup = ActionGroupObjectHandler::getInstance ()->getObject ($ actionGroupRef );
85
+ if ($ actionGroup == null ) {
86
+ throw new TestReferenceException ("Could not find ActionGroup by ref \"{$ actionGroupRef }\"" );
87
+ }
84
88
$ args = $ mergedStep ->getCustomActionAttributes ()[ActionObjectExtractor::ACTION_GROUP_ARGUMENTS ] ?? null ;
85
89
$ actionsToMerge = $ actionGroup ->getSteps ($ args , $ key );
86
90
$ newOrderedList = $ newOrderedList + $ actionsToMerge ;
0 commit comments