@@ -60,23 +60,51 @@ public function testBucketsList(string $devBranchType, string $userRole): void
6060
6161 $ this ->assertTrue (count ($ buckets ) >= 2 );
6262
63+ $ firstBucket = null ;
6364 $ inBucketFound = false ;
6465 $ outBucketFound = false ;
6566 foreach ($ buckets as $ bucket ) {
6667 if ($ bucket ['id ' ] == $ this ->getTestBucketId (self ::STAGE_IN )) {
6768 $ inBucketFound = true ;
69+ $ firstBucket = $ bucket ;
6870 }
6971 if ($ bucket ['id ' ] == $ this ->getTestBucketId (self ::STAGE_OUT )) {
7072 $ outBucketFound = true ;
7173 }
7274 }
7375 $ this ->assertTrue ($ inBucketFound );
7476 $ this ->assertTrue ($ outBucketFound );
77+ $ this ->assertNotNull ($ firstBucket );
7578
76- $ firstBucket = reset ($ buckets );
79+ $ this ->assertArrayHasKey ('id ' , $ firstBucket );
80+ $ this ->assertSame ($ this ->getTestBucketId (self ::STAGE_IN ), $ firstBucket ['id ' ]);
81+ $ this ->assertArrayHasKey ('name ' , $ firstBucket );
7782 $ this ->assertArrayHasKey ('displayName ' , $ firstBucket );
7883 $ this ->assertNotEquals ('' , $ firstBucket ['displayName ' ]);
7984 $ this ->assertArrayHasKey ('created ' , $ firstBucket );
85+ $ this ->assertArrayHasKey ('uri ' , $ firstBucket );
86+ $ this ->assertArrayHasKey ('tables ' , $ firstBucket );
87+ $ this ->assertArrayHasKey ('created ' , $ firstBucket );
88+ $ this ->assertArrayHasKey ('lastChangeDate ' , $ firstBucket );
89+ $ this ->assertArrayHasKey ('updated ' , $ firstBucket );
90+ $ this ->assertArrayHasKey ('idBranch ' , $ firstBucket );
91+ $ this ->assertArrayHasKey ('stage ' , $ firstBucket );
92+ $ this ->assertSame ('in ' , $ firstBucket ['stage ' ]);
93+ $ this ->assertArrayHasKey ('description ' , $ firstBucket );
94+ $ this ->assertArrayHasKey ('dataSizeBytes ' , $ firstBucket );
95+ $ this ->assertArrayHasKey ('rowsCount ' , $ firstBucket );
96+ $ this ->assertArrayHasKey ('backend ' , $ firstBucket );
97+ $ this ->assertArrayHasKey ('sharing ' , $ firstBucket );
98+ $ this ->assertArrayHasKey ('databaseName ' , $ firstBucket );
99+ $ this ->assertArrayHasKey ('path ' , $ firstBucket );
100+ $ this ->assertArrayHasKey ('color ' , $ firstBucket );
101+ $ this ->assertArrayHasKey ('owner ' , $ firstBucket );
102+ $ this ->assertArrayHasKey ('backendPath ' , $ firstBucket );
103+ $ this ->assertFalse ($ firstBucket ['isReadOnly ' ]);
104+ $ this ->assertFalse ($ firstBucket ['isMaintenance ' ]);
105+ $ this ->assertFalse ($ firstBucket ['hasExternalSchema ' ]);
106+ $ this ->assertFalse ($ firstBucket ['isSnowflakeSharedDatabase ' ]);
107+
80108 if ($ devBranchType === ClientProvider::DEV_BRANCH ) {
81109 $ this ->assertEquals ($ this ->clientProvider ->getExistingBranchForTestCase ()['id ' ], $ firstBucket ['idBranch ' ]);
82110 } elseif ($ devBranchType === ClientProvider::DEFAULT_BRANCH ) {
@@ -87,6 +115,9 @@ public function testBucketsList(string $devBranchType, string $userRole): void
87115 } else {
88116 throw new \Exception (sprintf ('Unknown devBranchType "%s" ' , $ devBranchType ));
89117 }
118+
119+ //@phpstan-ignore-next-line
120+ $ this ->assertBucketBackendPath ($ firstBucket );
90121 }
91122
92123 /**
@@ -109,6 +140,8 @@ public function testBucketDetail(string $devBranchType, string $userRole): void
109140 $ bucketId = $ this ->_testClient ->createBucket (name: $ bucketName , stage: self ::STAGE_IN , color: '#00FF00 ' );
110141
111142 $ bucket = $ this ->_testClient ->getBucket ($ bucketId );
143+ //@phpstan-ignore-next-line
144+ $ this ->assertBucketBackendPath ($ bucket );
112145 $ this ->assertEquals ($ branch ['id ' ], $ bucket ['idBranch ' ]);
113146
114147 $ this ->assertEquals ($ tokenData ['owner ' ]['defaultBackend ' ], $ bucket ['backend ' ]);
@@ -149,6 +182,8 @@ public function testBucketDetail(string $devBranchType, string $userRole): void
149182 $ bucketUpdateOptions = new BucketUpdateOptions ($ bucketId , $ displayName );
150183 $ bucketUpdateOptions ->deleteColor ();
151184 $ bucket = $ this ->_testClient ->updateBucket ($ bucketUpdateOptions );
185+ //@phpstan-ignore-next-line
186+ $ this ->assertBucketBackendPath ($ bucket );
152187 try {
153188 $ this ->_testClient ->createBucket ($ displayName , self ::STAGE_IN );
154189 $ this ->fail ('Should throw exception ' );
@@ -246,6 +281,29 @@ public function testBucketDetail(string $devBranchType, string $userRole): void
246281 $ this ->_testClient ->dropBucket ($ bucket ['id ' ]);
247282 }
248283
284+
285+ /**
286+ * @param array{
287+ * backendPath: string[],
288+ * backend: string,
289+ * path: string,
290+ * } $bucket
291+ */
292+ private function assertBucketBackendPath (array $ bucket ): void
293+ {
294+ if ($ bucket ['backend ' ] === self ::BACKEND_SNOWFLAKE ) {
295+ $ projectId = $ this ->getProjectId ($ this ->_testClient );
296+ $ this ->assertCount (2 , $ bucket ['backendPath ' ]);
297+ $ this ->assertStringContainsString ((string ) $ projectId , $ bucket ['backendPath ' ][0 ]);
298+ $ this ->assertSame ($ bucket ['path ' ], $ bucket ['backendPath ' ][1 ]);
299+ } elseif ($ bucket ['backend ' ] === self ::BACKEND_BIGQUERY ) {
300+ $ this ->assertCount (1 , $ bucket ['backendPath ' ]);
301+ $ this ->assertSame ($ bucket ['path ' ], $ bucket ['backendPath ' ][0 ]);
302+ } else {
303+ $ this ->fail ('Unknown backend ' . $ bucket ['backend ' ]);
304+ }
305+ }
306+
249307 private function assertBucketWithColumnMetadata (array $ bucket ): void
250308 {
251309 self ::assertArrayHasKey ('tables ' , $ bucket );
0 commit comments