Skip to content

Commit

Permalink
bucket cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Sep 26, 2024
1 parent cd6d5ce commit e319417
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions Storage/tests/System/StorageTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ class StorageTestCase extends SystemTestCase
protected static $pubsubClient;
protected static $object;
protected static $mainBucketName;
private static $hasSetUp = false;

/**
* @beforeClass
*/
public static function setUpTestFixtures(): void
{
if (self::$hasSetUp) {
return;
}

$config = [
'keyFilePath' => getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH'),
'transport' => 'rest'
Expand All @@ -67,20 +62,16 @@ public static function setUpTestFixtures(): void
['location' => 'us-west1']
);
self::$object = self::$bucket->upload('somedata', ['name' => uniqid(self::TESTING_PREFIX)]);

self::$hasSetUp = true;
}

/**
* @afterClass
*/
public static function tearDownTestFixtures(): void
{
if (!self::$hasSetUp) {
return;
foreach (self::$bucket->objects() as $object) {
$object->delete();
}

self::$object->delete();
self::$bucket->delete();
}

Expand Down

0 comments on commit e319417

Please sign in to comment.