Google\Cloud\Tests\Snippets\Storage\BucketTest::testUploadResumableUploader PHP Method

testUploadResumableUploader() public method

    public function testUploadResumableUploader()
    {
        $snippet = $this->snippetFromMethod(Bucket::class, 'upload', 1);
        $snippet->addLocal('bucket', $this->bucket);
        $snippet->replace("__DIR__ . '/image.jpg'", '"php://temp"');
        $uploader = $this->prophesize(ResumableUploader::class);
        $uploader->upload()->shouldBeCalled()->willReturn(['name' => 'Foo', 'generation' => 'Bar']);
        $this->connection->insertObject(Argument::any())->shouldBeCalled()->willReturn($uploader->reveal());
        $this->bucket->setConnection($this->connection->reveal());
        $res = $snippet->invoke('object');
        $this->assertInstanceOf(StorageObject::class, $res->returnVal());
    }