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

testRunQueryAsJobWithPositionalParameters() public method

    public function testRunQueryAsJobWithPositionalParameters()
    {
        $job = self::$client->runQueryAsJob('SELECT 1 IN UNNEST(?) AS arr', ['parameters' => [[1, 2, 3]]]);
        $results = $job->queryResults();
        $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 = iterator_to_array($results->rows());
        $expectedRows = [['arr' => true]];
        $this->assertEquals($expectedRows, $actualRows);
    }