Skip to content

Commit 089b88d

Browse files
committed
MQE-1676: Add a static-check that ensures action groups do not have unused arguments
fixed unit tests
1 parent 731a770 commit 089b88d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Magento/FunctionalTestingFramework/StaticCheck/ActionGroupArgumentsCheck.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ private function buildUnusedArgumentList($actionGroups)
128128
}
129129

130130
/**
131-
* @param $actionGroupXml
131+
* Returns unused arguments in an action group
132+
* @param string $actionGroupXml
132133
* @return array
133134
*/
134135
private function findUnusedArguments($actionGroupXml)
@@ -171,8 +172,9 @@ private function findUnusedArguments($actionGroupXml)
171172
*/
172173
private function isParentActionGroupArgument($argument, $actionGroup)
173174
{
174-
if ($actionGroup->getParentName() !== null) {
175-
$parentActionGroup = ActionGroupObjectHandler::getInstance()->getObject($actionGroup->getParentName());
175+
$parentActionGroupName = $actionGroup->getParentName();
176+
if ($parentActionGroupName !== null) {
177+
$parentActionGroup = ActionGroupObjectHandler::getInstance()->getObject($parentActionGroupName);
176178
$parentArguments = $parentActionGroup->getArguments();
177179
foreach ($parentArguments as $parentArgument) {
178180
if ($argument === $parentArgument->getName()) {

src/Magento/FunctionalTestingFramework/StaticCheck/StaticCheckHelper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function printErrorsToFile($errors, $filename, $message)
3838

3939
/**
4040
* Builds list of all XML files in given modulePaths + path given
41-
* @param array $modulePaths
41+
* @param array $modulePaths
4242
* @param string $path
4343
* @return Finder
4444
*/
@@ -53,5 +53,4 @@ public static function buildFileList($modulePaths, $path)
5353
}
5454
return $finder->files();
5555
}
56-
5756
}

0 commit comments

Comments
 (0)