Google\Cloud\Tests\Snippets\BigQuery\TableTest::testCopy PHP Method

testCopy() public method

public testCopy ( )
    public function testCopy()
    {
        $bq = new \BigQueryClientStub();
        $snippet = $this->snippetFromMethod(Table::class, 'copy');
        $snippet->addLocal('bigQuery', $bq);
        $bq->setConnection($this->connection->reveal());
        $this->connection->insertJob(Argument::any())->shouldBeCalled()->willReturn(['jobReference' => ['jobId' => '123']]);
        $this->table->setConnection($this->connection->reveal());
        $res = $snippet->invoke('job');
        $this->assertInstanceOf(Job::class, $res->returnVal());
    }