Skip to content

Commit

Permalink
Merge pull request #57 from AmpersandHQ/try-non-usual-path
Browse files Browse the repository at this point in the history
Fix handling of non-absolute magento path when outputting results
convenient authored Jun 3, 2021
2 parents f627d43 + 0dbc75e commit 630e85b
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dev/phpunit/functional/FunctionalTests.php
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ public function testMagentoTwoFour()
{
$this->assertFileExists(BASE_DIR . '/dev/instances/magento24/app/etc/env.php', "Magento 2.4 is not installed");

exec($this->generateAnalyseCommand('/dev/instances/magento24', '--sort-by-type --vendor-namespaces Ampersand'), $output, $return);
exec($this->generateAnalyseCommand('/dev/instances/../instances/magento24', '--sort-by-type --vendor-namespaces Ampersand'), $output, $return);
$this->assertEquals(0, $return, "The return code of the command was not zero");

$lastLine = array_pop($output);
@@ -204,7 +204,7 @@ public function testMagentoTwoFourNoDb()
$this->assertFileExists(BASE_DIR . '/dev/instances/magento24nodb/app/etc/di.xml', "Magento 2.4 directory is wrong");
$this->assertFileNotExists(BASE_DIR . '/dev/instances/magento24nodb/app/etc/env.php', "Magento 2.4 is installed when it shouldnt be");

exec($this->generateAnalyseCommand('/dev/instances/magento24nodb', '--sort-by-type --vendor-namespaces Ampersand'), $output, $return);
exec($this->generateAnalyseCommand('/dev/instances/../instances/magento24nodb', '--sort-by-type --vendor-namespaces Ampersand'), $output, $return);
$this->assertEquals(0, $return, "The return code of the command was not zero");

$lastLine = array_pop($output);
2 changes: 1 addition & 1 deletion src/Ampersand/PatchHelper/Command/AnalyseCommand.php
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$patchFilesToOutput[$file] = $patchFile;
}
foreach ($errors as $error) {
$summaryOutputData[] = [$errorType, $file, ltrim(str_replace($projectDir, '', $error), '/')];
$summaryOutputData[] = [$errorType, $file, ltrim(str_replace(realpath($projectDir), '', $error), '/')];
if ($errorType === Helper\PatchOverrideValidator::TYPE_FILE_OVERRIDE
&& $input->getOption('auto-theme-update') && is_numeric($input->getOption('auto-theme-update'))) {
$patchFile->applyToTheme($projectDir, $error, $input->getOption('auto-theme-update'));

0 comments on commit 630e85b

Please sign in to comment.