Skip to content

Commit

Permalink
cleanup from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Sep 27, 2024
1 parent fa97870 commit 07cc2e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Core/src/Testing/TestHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Google\Cloud\Core\Testing\Snippet\Coverage\Coverage;
use Google\Cloud\Core\Testing\Snippet\Coverage\Scanner;
use Google\Cloud\Core\Testing\Snippet\Parser\Parser;
use Google\Cloud\Core\Testing\Snippet\Fixtures;
use Google\Cloud\Core\Testing\System\SystemTestCase;

/**
Expand Down Expand Up @@ -106,7 +107,7 @@ public function call($fn, array $args = []) { return call_user_func_array([$this
*/
public static function snippetBootstrap()
{
putenv('GOOGLE_APPLICATION_CREDENTIALS='. \Google\Cloud\Core\Testing\Snippet\Fixtures::KEYFILE_STUB_FIXTURE());
putenv('GOOGLE_APPLICATION_CREDENTIALS='. Fixtures::KEYFILE_STUB_FIXTURE());

$parser = new Parser;
$scanner = new Scanner($parser, self::projectRoot(), [
Expand Down
6 changes: 4 additions & 2 deletions Redis/tests/System/V1/CloudRedisClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ class CloudRedisClientTest extends TestCase
*/
public static function setUpTestFixtures()
{
$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH');
if (!$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH')) {
self::markTestSkipped('Set the GOOGLE_CLOUD_PHP_TESTS_KEY_PATH environment variable');
}
$keyFileData = json_decode(file_get_contents($keyFilePath), true);
$projectId = $keyFileData['project_id'];
$projectId = $keyFileData['project_id'] ?? '';

self::$client = new CloudRedisClient([
'credentials' => $keyFilePath,
Expand Down

0 comments on commit 07cc2e1

Please sign in to comment.