Skip to content

Commit 9060cd1

Browse files
authored
minor #1563 [tests] dont sign commits in tests
1 parent 4e41461 commit 9060cd1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Test/MakerTestEnvironment.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
*/
2323
final class MakerTestEnvironment
2424
{
25+
// Config used for creating tmp flex project and test app's
26+
private const GIT_CONFIG = 'git config user.name "symfony" && git config user.email "[email protected]" && git config commit.gpgsign false && git config user.signingkey false';
27+
2528
public const GENERATED_FILES_REGEX = '#(?:created|updated):\s(?:.*\\\\)*(.*\.[a-z]{3,4}).*(?:\\\\n)?#ui';
2629

2730
private Filesystem $fs;
@@ -173,7 +176,7 @@ public function prepareDirectory(): void
173176

174177
file_put_contents($this->path.'/.gitignore', "var/cache/\nvendor/\n");
175178

176-
MakerTestProcess::create('git diff --quiet || ( git config user.name "symfony" && git config user.email "[email protected]" && git add . && git commit -a -m "second commit" )',
179+
MakerTestProcess::create(sprintf('git diff --quiet || ( %s && git add . && git commit -a -m "second commit" )', self::GIT_CONFIG),
177180
$this->path
178181
)->run();
179182
} catch (\Exception $e) {
@@ -291,7 +294,7 @@ private function buildFlexSkeleton(): void
291294
file_put_contents($this->flexPath.'/.gitignore', "var/cache/\n");
292295

293296
// Force adding vendor/ dir to Git repo in case users exclude it in global .gitignore
294-
MakerTestProcess::create('git init && git config user.name "symfony" && git config user.email "[email protected]" && git add . && git add vendor/ -f && git commit -a -m "first commit"',
297+
MakerTestProcess::create(sprintf('git init && %s && git add . && git add vendor/ -f && git commit -a -m "first commit"', self::GIT_CONFIG),
295298
$this->flexPath
296299
)->run();
297300
}

0 commit comments

Comments
 (0)