Google\Cloud\Tests\System\BigQuery\BigQueryTestCase::setUpBeforeClass PHP Method

setUpBeforeClass() public static method

public static setUpBeforeClass ( )
    public static function setUpBeforeClass()
    {
        if (self::$hasSetUp) {
            return;
        }
        $keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH');
        $schema = ['fields' => [['name' => 'city', 'type' => 'STRING'], ['name' => 'state', 'type' => 'STRING']]];
        self::$bucket = (new StorageClient(['keyFilePath' => $keyFilePath]))->createBucket(uniqid(self::TESTING_PREFIX));
        self::$client = new BigQueryClient(['keyFilePath' => $keyFilePath]);
        self::$dataset = self::$client->createDataset(uniqid(self::TESTING_PREFIX));
        self::$table = self::$dataset->createTable(uniqid(self::TESTING_PREFIX), ['schema' => $schema]);
        self::$hasSetUp = true;
    }