Skip to content

Commit 1449e0e

Browse files
committed
chore(PubSub): Adding GCPServiceAccount and AWSRoleArn class variables to pubsubTest
1 parent 4a9b7a7 commit 1449e0e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pubsub/api/test/pubsubTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace Google\Cloud\Samples\PubSub;
1919

20+
use Google\Auth\Credentials\ServiceAccountCredentials;
2021
use Google\Cloud\TestUtils\TestTrait;
2122
use Google\Cloud\TestUtils\ExecuteCommandTrait;
2223
use Google\Cloud\TestUtils\EventuallyConsistentTestTrait;
@@ -32,10 +33,17 @@ class PubSubTest extends TestCase
3233
use EventuallyConsistentTestTrait;
3334

3435
private static $eodSubscriptionId;
36+
private static $awsRoleArn = "arn:aws:iam::111111111111:role/fake-role-name";
37+
private static $gcpServiceAccount;
3538

3639
public static function setUpBeforeClass(): void
3740
{
3841
self::$eodSubscriptionId = 'test-eod-subscription-' . rand();
42+
$serviceAccountPath = self::requireEnv('GOOGLE_APPLICATION_CREDENTIALS');
43+
$serviceAccountCredentials = new ServiceAccountCredentials(
44+
'https://www.googleapis.com/auth/cloud-platform',
45+
$serviceAccountPath);
46+
self::$gcpServiceAccount = $serviceAccountCredentials->getClientName();
3947
}
4048

4149
public function testSubscriptionPolicy()

0 commit comments

Comments
 (0)