Google\Cloud\Tests\System\Storage\ManageBucketsTest::testListsBuckets PHP Method

testListsBuckets() public method

public testListsBuckets ( )
    public function testListsBuckets()
    {
        $foundBuckets = [];
        $bucketsToCreate = [uniqid(self::TESTING_PREFIX), uniqid(self::TESTING_PREFIX)];
        foreach ($bucketsToCreate as $bucketToCreate) {
            self::$deletionQueue[] = self::$client->createBucket($bucketToCreate);
        }
        $buckets = self::$client->buckets(['prefix' => self::TESTING_PREFIX]);
        foreach ($buckets as $bucket) {
            foreach ($bucketsToCreate as $key => $bucketToCreate) {
                if ($bucket->name() === $bucketToCreate) {
                    $foundBuckets[$key] = $bucket->name();
                }
            }
        }
        $this->assertEquals($bucketsToCreate, $foundBuckets);
    }