Contao\CoreBundle\Test\Contao\ImageTest::testExecuteResizeSvgWithoutViewBoxAndDimensions PHP Method

testExecuteResizeSvgWithoutViewBoxAndDimensions() public method

Tests resizing an SVG image without a view box and dimensions.
    public function testExecuteResizeSvgWithoutViewBoxAndDimensions()
    {
        file_put_contents(self::$rootDir . '/dummy.svg', '<?xml version="1.0" encoding="utf-8"?>
            <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
            <svg
                version="1.1"
                xmlns="http://www.w3.org/2000/svg"
            ></svg>');
        $file = new \File('dummy.svg');
        $imageObj = new Image($file);
        $imageObj->setTargetWidth(100)->setTargetHeight(100);
        $imageObj->executeResize();
        $resultFile = new \File($imageObj->getResizedPath());
        $this->assertEquals($file->path, $resultFile->path);
    }