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

testLoad() public method

public testLoad ( )
    public function testLoad()
    {
        $snippet = $this->snippetFromMethod(Table::class, 'load');
        $snippet->addLocal('table', $this->table);
        $snippet->replace('/path/to/my/data.csv', 'php://temp');
        $uploader = $this->prophesize(MultipartUploader::class);
        $uploader->upload()->shouldBeCalled()->willReturn(['jobReference' => ['jobId' => '123']]);
        $this->connection->insertJobUpload(Argument::any())->shouldBeCalled()->willReturn($uploader->reveal());
        $this->table->setConnection($this->connection->reveal());
        $res = $snippet->invoke('job');
        $this->assertInstanceOf(Job::class, $res->returnVal());
    }