Skip to content

Commit 6e3d1ba

Browse files
committed
MQE-1704: MFTF Compatibility with PHPUnit 9
adding log for MagentoAllureAdapter
1 parent a23844b commit 6e3d1ba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Codeception\Event\SuiteEvent;
2828
use Codeception\Event\StepEvent;
2929
use Codeception\Event\TestEvent;
30+
use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil;
3031

3132
/**
3233
* Class MagentoAllureAdapter
@@ -62,6 +63,7 @@ class MagentoAllureAdapter extends AllureCodeception
6263
private function getGroup()
6364
{
6465
if ($this->options['groups'] != null) {
66+
LoggingUtil::getInstance()->getLogger("Inside getGroup() --> :" . $this->options['groups'][0]);
6567
return $this->options['groups'][0];
6668
}
6769
return null;
@@ -79,7 +81,9 @@ public function suiteBefore(SuiteEvent $suiteEvent)
7981

8082
if ($this->getGroup() != null) {
8183
$suite = $suiteEvent->getSuite();
84+
LoggingUtil::getInstance()->getLogger("Output of suite->getName() :" . $suite->getName());
8285
$suiteName = ($suite->getName()) . "\\" . $this->sanitizeGroupName($this->getGroup());
86+
LoggingUtil::getInstance()->getLogger("Value of suiteName :" . $suiteName);
8387

8488
call_user_func(\Closure::bind(
8589
function () use ($suite, $suiteName) {
@@ -110,9 +114,11 @@ private function sanitizeGroupName($group)
110114
{
111115
$suiteNames = array_keys(SuiteObjectHandler::getInstance()->getAllObjects());
112116
$exactMatch = in_array($group, $suiteNames);
117+
LoggingUtil::getInstance()->getLogger("Inside sanitizeGroupName()");
113118

114119
// if this is an existing suite name we dont' need to worry about changing it
115120
if ($exactMatch || strpos($group, "_") === false) {
121+
LoggingUtil::getInstance()->getLogger("Inside sanitizeGroupName() --> exact match found or no _ found");
116122
return $group;
117123
}
118124

@@ -123,6 +129,7 @@ private function sanitizeGroupName($group)
123129

124130
// confirm our original name is one of the existing suite names otherwise just return the original group name
125131
$originalName = in_array($originalName, $suiteNames) ? $originalName : $group;
132+
LoggingUtil::getInstance()->getLogger("Inside sanitizeGroupName() --> Return original name: " . $originalName);
126133
return $originalName;
127134
}
128135

0 commit comments

Comments
 (0)