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

testExecuteResizeStandardCropResizeAndFileExistsAlready() public method

Tests resizing an image which has to be cropped and has an existing target defined.
    public function testExecuteResizeStandardCropResizeAndFileExistsAlready()
    {
        $file = new \File('dummy.jpg');
        $imageObj = new Image($file);
        $imageObj->setTargetWidth(100)->setTargetHeight(100)->setTargetPath('dummy_foobar.jpg');
        $imageObj->executeResize();
        $imageObj = new Image($file);
        $imageObj->setTargetWidth(100)->setTargetHeight(100);
        $imageObj->executeResize();
        $resultFile = new \File($imageObj->getResizedPath());
        $this->assertSame($resultFile->width, 100);
        $this->assertSame($resultFile->height, 100);
    }