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

testLoadFromStorage() public method

public testLoadFromStorage ( )
    public function testLoadFromStorage()
    {
        $storage = new \StorageClientStub();
        $storage->setConnection($this->prophesize(StorageConnectionInterface::class)->reveal());
        $snippet = $this->snippetFromMethod(Table::class, 'loadFromStorage');
        $snippet->addLocal('storage', $storage);
        $snippet->addLocal('table', $this->table);
        $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());
    }