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

testExecuteResizeStandardCropResizeAndTarget() public method

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