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

testRename() public method

public testRename ( )
    public function testRename()
    {
        $snippet = $this->snippetFromMethod(StorageObject::class, 'rename');
        $snippet->addLocal('object', $this->object);
        $this->connection->copyObject(Argument::any())->shouldBeCalled()->willReturn(['name' => 'object2.txt', 'bucket' => self::BUCKET, 'generation' => 'foo']);
        $this->connection->deleteObject(Argument::any())->shouldBeCalled();
        $this->object->setConnection($this->connection->reveal());
        $res = $snippet->invoke();
        $this->assertEquals('object2.txt', $res->output());
    }