Skip to content

Commit 8d1ecb9

Browse files
committed
Adding git config for tests
1 parent 8b4fb88 commit 8d1ecb9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/Command/UpdateRecipesCommandTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public function testCommandUpdatesRecipe()
4545
{
4646
@mkdir(FLEX_TEST_DIR);
4747
(new Process(['git', 'init'], FLEX_TEST_DIR))->mustRun();
48+
(new Process(['git', 'config', 'user.name', 'Unit test'], FLEX_TEST_DIR))->mustRun();
49+
(new Process(['git', 'config', 'user.email'], FLEX_TEST_DIR))->mustRun();
4850

4951
@mkdir(FLEX_TEST_DIR.'/bin');
5052

tests/Update/RecipePatcherTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ public function testGeneratePatchOnDeletedFile()
200200
public function testApplyPatch(array $filesCurrentlyInApp, RecipePatch $recipePatch, array $expectedFiles, bool $expectedConflicts)
201201
{
202202
(new Process(['git', 'init'], FLEX_TEST_DIR))->mustRun();
203+
(new Process(['git', 'config', 'user.name', 'Unit test'], FLEX_TEST_DIR))->mustRun();
204+
(new Process(['git', 'config', 'user.email'], FLEX_TEST_DIR))->mustRun();
203205

204206
foreach ($filesCurrentlyInApp as $file => $contents) {
205207
$path = FLEX_TEST_DIR.'/'.$file;
@@ -313,6 +315,8 @@ public function testIntegration(bool $useNullForMissingFiles)
313315
{
314316
$files = $this->getFilesForPatching();
315317
(new Process(['git', 'init'], FLEX_TEST_DIR))->mustRun();
318+
(new Process(['git', 'config', 'user.name', 'Unit test'], FLEX_TEST_DIR))->mustRun();
319+
(new Process(['git', 'config', 'user.email'], FLEX_TEST_DIR))->mustRun();
316320

317321
$startingFiles = [
318322
'.env' => $files['dot_env_clean']['in_app'],
@@ -540,6 +544,8 @@ private function generatePatchData(string $filename, ?string $start, ?string $en
540544
}
541545
@mkdir($dir);
542546
(new Process(['git', 'init'], $dir))->mustRun();
547+
(new Process(['git', 'config', 'user.name', 'Unit test'], $dir))->mustRun();
548+
(new Process(['git', 'config', 'user.email'], $dir))->mustRun();
543549

544550
if (!file_exists(\dirname($dir.'/'.$filename))) {
545551
@mkdir(\dirname($dir.'/'.$filename), 0777, true);

0 commit comments

Comments
 (0)