Google\Cloud\Tests\Snippets\Storage\StorageObjectTest::testCopy PHP Method

testCopy() public method

public testCopy ( )
    public function testCopy()
    {
        $snippet = $this->snippetFromMethod(StorageObject::class, 'copy');
        $snippet->addLocal('object', $this->object);
        $this->connection->copyObject(Argument::any())->shouldBeCalled()->willReturn(['name' => 'New Object', 'bucket' => self::BUCKET, 'generation' => 'foo']);
        $this->object->setConnection($this->connection->reveal());
        $res = $snippet->invoke('copiedObject');
        $this->assertInstanceOf(StorageObject::class, $res->returnVal());
    }