Google\Cloud\Tests\System\BigQuery\LoadDataAndQueryTest::testRunQuery PHP Method

testRunQuery() public method

public testRunQuery ( )
    public function testRunQuery()
    {
        $results = self::$client->runQuery(sprintf('SELECT * FROM [%s.%s]', self::$dataset->id(), self::$table->id()));
        $backoff = new ExponentialBackoff(8);
        $backoff->execute(function () use($results) {
            $results->reload();
            if (!$results->isComplete()) {
                throw new \Exception();
            }
        });
        if (!$results->isComplete()) {
            $this->fail('Query did not complete within the allotted time.');
        }
        $actualRows = count(iterator_to_array($results->rows()));
        $this->assertEquals(self::$expectedRows, $actualRows);
    }