Skip to content

Commit 4a306c2

Browse files
committed
MQE-1676: Add a static-check that ensures action groups do not have unused arguments
fixing unit tests
1 parent cc3601a commit 4a306c2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/Magento/FunctionalTestingFramework/StaticCheck/ActionGroupArgumentsCheck.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ public function execute(InputInterface $input)
5858

5959
$this->errors += $this->setErrorOutput($unusedArgumentList);
6060

61-
$this->output = StaticCheckHelper::printErrorsToFile($this->errors,
62-
self::ERROR_LOG_FILENAME, self::ERROR_LOG_MESSAGE);
61+
$this->output = StaticCheckHelper::printErrorsToFile(
62+
$this->errors,
63+
self::ERROR_LOG_FILENAME,
64+
self::ERROR_LOG_MESSAGE
65+
);
6366
}
6467

6568
/**
@@ -135,12 +138,12 @@ private function findUnusedArguments($actionGroup)
135138

136139
/**
137140
* Checks if the argument is also defined in the parent for extending action groups.
138-
* @param string $argument
141+
* @param string $argument
139142
* @param ActionGroupObject $actionGroup
140-
* @return bool
143+
* @return boolean
141144
*/
142-
private function isParentActionGroupArgument($argument, $actionGroup) {
143-
145+
private function isParentActionGroupArgument($argument, $actionGroup)
146+
{
144147
if ($actionGroup->getParentName() !== null) {
145148
$parentActionGroup = ActionGroupObjectHandler::getInstance()->getObject($actionGroup->getParentName());
146149
$parentArguments = $parentActionGroup->getArguments();

src/Magento/FunctionalTestingFramework/StaticCheck/TestDependencyCheck.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ public function execute(InputInterface $input)
127127
$this->errors += $this->findErrorsInFileSet($dataXmlFiles);
128128

129129
// hold on to the output and print any errors to a file
130-
$this->output = StaticCheckHelper::printErrorsToFile($this->errors,
131-
self::ERROR_LOG_FILENAME, self::ERROR_LOG_MESSAGE);
130+
$this->output = StaticCheckHelper::printErrorsToFile(
131+
$this->errors,
132+
self::ERROR_LOG_FILENAME,
133+
self::ERROR_LOG_MESSAGE
134+
);
132135
}
133136

134137
/**

0 commit comments

Comments
 (0)