Skip to content

Commit

Permalink
Merge pull request #225 from ghostwriter/bugfix/failing-env-specific-…
Browse files Browse the repository at this point in the history
…tests-224

Fix env-specific tests
  • Loading branch information
Ocramius authored Dec 18, 2022
2 parents 49d9580 + aa7dacd commit e7321df
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/unit/Environment/EnvironmentVariablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ public function testFailsOnMissingEnvironmentVariables(): void

public function testDebugModeOffEnvironmentVariables(): void
{
// commented to signify a missing env variable.
// Env\set_var('ACTIONS_RUNNER_DEBUG', '');
// missing env variable.
Env\remove_var('ACTIONS_RUNNER_DEBUG');

Env\set_var('GITHUB_TOKEN', 'token');
Env\set_var('SIGNING_SECRET_KEY', 'aaa');
Env\set_var('GITHUB_ORGANISATION', 'bbb');
Expand All @@ -128,7 +129,7 @@ public function testDebugModeOffEnvironmentVariables(): void
$importKey = $this->createMock(ImportGpgKeyFromString::class);
$importKey->method('__invoke')->willReturn(SecretKeyId::fromBase16String('aabbccdd'));
$variables = EnvironmentVariables::fromEnvironment($importKey);
self::assertEquals('INFO', $variables->logLevel());
self::assertSame('INFO', $variables->logLevel());
}

public function testDebugModeOnEnvironmentVariables(): void
Expand All @@ -146,6 +147,6 @@ public function testDebugModeOnEnvironmentVariables(): void
$importKey->method('__invoke')->willReturn(SecretKeyId::fromBase16String('aabbccdd'));
$variables = EnvironmentVariables::fromEnvironment($importKey);

self::assertEquals('DEBUG', $variables->logLevel());
self::assertSame('DEBUG', $variables->logLevel());
}
}

0 comments on commit e7321df

Please sign in to comment.