Skip to content

Commit

Permalink
Fixed monolog warning method usage in PHPUnit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drpayyne committed Jun 19, 2021
1 parent e08eb9f commit 11a6208
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected function verifyFileEmpty($content, $fileName)
{
if (empty($content)) {
if (MftfApplicationConfig::getConfig()->verboseEnabled()) {
LoggingUtil::getInstance()->getLogger(Filesystem::class)->warn(
LoggingUtil::getInstance()->getLogger(Filesystem::class)->warning(
"XML File is empty.",
["File" => $fileName]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function retrieveEntityField($stepKey, $field, $scope)
$warnMsg = "Undefined field {$field} in entity object with a stepKey of {$stepKey}\n";
$warnMsg .= "Please fix the invalid reference. This will result in fatal error in next major release.";
//TODO: change this to throw an exception in next major release
LoggingUtil::getInstance()->getLogger(PersistedObjectHandler::class)->warn($warnMsg);
LoggingUtil::getInstance()->getLogger(PersistedObjectHandler::class)->warning($warnMsg);
if (MftfApplicationConfig::getConfig()->verboseEnabled()
&& MftfApplicationConfig::getConfig()->getPhase() !== MftfApplicationConfig::UNIT_TEST_PHASE) {
print("\n$warnMsg\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private function auditMergeSteps($stepKeyRefs, $testName)
});

foreach ($atRiskStepRef as $stepKey => $stepRefs) {
LoggingUtil::getInstance()->getLogger(ActionObjectExtractor::class)->warn(
LoggingUtil::getInstance()->getLogger(ActionObjectExtractor::class)->warning(
'multiple actions referencing step key',
['test' => $testName, 'stepKey' => $stepKey, 'ref' => $stepRefs]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ private function setArrayValueWithLogging($inArray, $index, $value)
} else {
$warnMsg = 'Path: ' . $value . ' is ignored by ModuleResolver. ' . PHP_EOL . 'Path: ';
$warnMsg .= $inArray[$index] . ' is set for Module: ' . $index . PHP_EOL;
LoggingUtil::getInstance()->getLogger(ModuleResolver::class)->warn($warnMsg);
LoggingUtil::getInstance()->getLogger(ModuleResolver::class)->warning($warnMsg);
}
return $outArray;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore)
if (MftfApplicationConfig::getConfig()->verboseEnabled()) {
print("NOTICE: {$errMessage}");
}
LoggingUtil::getInstance()->getLogger(self::class)->warn($errMessage);
LoggingUtil::getInstance()->getLogger(self::class)->warning($errMessage);
continue;
}
}
Expand Down

0 comments on commit 11a6208

Please sign in to comment.