diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index c5b48ba83..350a004f3 100644 --- a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php @@ -7,6 +7,7 @@ namespace Magento\FunctionalTestingFramework\Console; +use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Filesystem\Filesystem; @@ -17,6 +18,12 @@ use Magento\FunctionalTestingFramework\Util\Env\EnvProcessor; use Symfony\Component\Yaml\Yaml; +/** + * Class BuildProjectCommand + * @package Magento\FunctionalTestingFramework\Console + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class BuildProjectCommand extends Command { const DEFAULT_YAML_INLINE_DEPTH = 10; @@ -147,6 +154,12 @@ private function generateConfigFiles(OutputInterface $output) self::CREDENTIALS_FILE_PATH ); + // Remove and Create Log File + $logPath = LoggingUtil::getInstance()->getLoggingPath(); + $fileSystem->remove($logPath); + $fileSystem->touch($logPath); + $fileSystem->chmod($logPath, 0777); + $output->writeln('.credentials.example successfully applied.'); } } diff --git a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php index 536a4a698..78b0c29ef 100644 --- a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php @@ -75,7 +75,7 @@ public function getLogger($clazz) * * @return string */ - private function getLoggingPath() + public function getLoggingPath() { return TESTS_BP . DIRECTORY_SEPARATOR . "mftf.log"; }