Skip to content

Commit 6da6dd1

Browse files
committed
AC-3208: Fixed Tests
1 parent be2939c commit 6da6dd1

File tree

8 files changed

+8
-9
lines changed

8 files changed

+8
-9
lines changed

src/MagentoHackathon/Composer/Magento/Deploystrategy/Symlink.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ public function getRelativePath($from, $to)
141141
}
142142

143143
// magento_dir/targetdir/childdir => ../../module_dir/sourcedir/childdir
144-
$relativePath = str_repeat('../', count($dir)) . implode('/', $file);
145-
return $relativePath;
144+
return str_repeat('../', count($dir) - 1) . implode('/', $file);
146145
}
147146
}

tests/FullStackTest/home/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
}
77
],
88
"require": {
9-
"magento/magento-composer-installer": "*"
9+
"magento/magento-composer-installer": "*",
10+
"magento/magento2-base-mock": "*"
1011
},
1112
"extra": {
1213
"magento-root-dir": "root"

tests/MagentoHackathon/Composer/Magento/FullStack/AbstractTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function setUpBeforeClass(): void
4848
@unlink(self::getBasePath().'/magento-modules/vendor/theseer/directoryscanner/tests/_data/nested/empty');
4949

5050
$process = Process::fromShellCommandline(
51-
self::getComposerCommand().' archive --format=zip --dir="tests/FullStackTest/artifact" -vvv',
51+
'./' . self::getComposerCommand().' archive --format=zip --dir="tests/FullStackTest/artifact" -vvv',
5252
self::getProjectRoot()
5353
);
5454
$process->run();
@@ -118,7 +118,7 @@ protected static function logProcessOutput(Process $process, $name = null){
118118
$name . '_Output.log'
119119
]);
120120
if (!is_dir(dirname($logPath))) {
121-
mkdir(dirname($logPath));
121+
mkdir(dirname($logPath), 0777, true);
122122
}
123123
file_put_contents(
124124
$logPath,
@@ -135,4 +135,4 @@ public function assertProcess(Process $process)
135135
$message .= PHP_EOL.'Output:'.PHP_EOL.$process->getOutput();
136136
$this->assertEquals(0, $process->getExitCode(), $message);
137137
}
138-
}
138+
}

tests/MagentoHackathon/Composer/Magento/FullStack/GlobalPluginTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class GlobalPluginTest extends AbstractTest
99
{
10-
1110
protected static $processLogCounter = 1;
1211

1312
protected function setUp(): void
@@ -31,7 +30,7 @@ protected function prepareCleanDirectories()
3130
public function testGlobalInstall()
3231
{
3332
$process = Process::fromShellCommandline(
34-
self::getComposerCommand() . ' global install',
33+
'./' . self::getComposerCommand() . ' global install',
3534
self::getProjectRoot(),
3635
['COMPOSER_HOME' => self::getBasePath() . '/home']
3736
);
@@ -43,7 +42,7 @@ public function testGlobalInstall()
4342
public function testGlobalUpdate()
4443
{
4544
$process = Process::fromShellCommandline(
46-
self::getComposerCommand() . ' global update',
45+
'./' . self::getComposerCommand() . ' global update',
4746
self::getProjectRoot(),
4847
['COMPOSER_HOME' => self::getBasePath() . '/home']
4948
);

tests/res/packages/magento2-base/app/code/.gitkeep

Whitespace-only changes.

tests/res/packages/magento2-base/app/design/.gitkeep

Whitespace-only changes.

tests/res/packages/magento2-base/app/etc/.gitkeep

Whitespace-only changes.

tests/res/packages/magento2-base/app/i18n/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)