@@ -836,6 +836,7 @@ public function testGetBucketWithAutoclass()
836836 $ bucket = self ::$ storage ->createBucket ($ bucketName , [
837837 'autoclass ' => [
838838 'enabled ' => true ,
839+ 'terminalStorageClass ' => 'ARCHIVE ' ,
839840 ],
840841 'location ' => 'US ' ,
841842 ]);
@@ -849,30 +850,38 @@ public function testGetBucketWithAutoclass()
849850 sprintf ('Bucket %s has autoclass enabled: %s ' , $ bucketName , true ),
850851 $ output
851852 );
853+ $ this ->assertStringContainsString (
854+ sprintf ('Autoclass terminal storage class is set to %s ' , 'ARCHIVE ' ),
855+ $ output
856+ );
852857 }
853858
854859 public function testSetBucketWithAutoclass ()
855860 {
856861 $ bucket = self ::$ storage ->createBucket (uniqid ('samples-set-autoclass- ' ), [
857- 'autoclass ' => [
858- 'enabled ' => true ,
859- ],
860862 'location ' => 'US ' ,
861863 ]);
862- $ info = $ bucket ->reload ();
863- $ this ->assertArrayHasKey ('autoclass ' , $ info );
864- $ this ->assertTrue ($ info ['autoclass ' ]['enabled ' ]);
865864
865+ $ terminalStorageClass = 'ARCHIVE ' ;
866866 $ output = self ::runFunctionSnippet ('set_bucket_autoclass ' , [
867867 $ bucket ->name (),
868- false
868+ true ,
869+ $ terminalStorageClass
869870 ]);
870871 $ bucket ->delete ();
871872
872873 $ this ->assertStringContainsString (
873874 sprintf (
874- 'Updated bucket %s with autoclass set to false. ' ,
875- $ bucket ->name (),
875+ 'Updated bucket %s with autoclass set to true. ' ,
876+ $ bucket ->name ()
877+ ),
878+ $ output
879+ );
880+
881+ $ this ->assertStringContainsString (
882+ sprintf (
883+ 'Autoclass terminal storage class is %s. ' . PHP_EOL ,
884+ $ terminalStorageClass
876885 ),
877886 $ output
878887 );
0 commit comments