setSource($srcWidth, $srcHeight) ->setBaseWidthHeight($targetWidth, $targetHeight) ->setResizeStrategy(CImageResizer::FILL_TO_FIT) ->calculateTargetWidthAndHeight(); $this->assertEquals($targetWidthAfter, $img->getTargetWidth(), "Target width not correct."); $this->assertEquals($targetHeightAfter, $img->getTargetHeight(), "Target height not correct."); $this->assertEquals($cropX, $img->getCropX(), "CropX not correct."); $this->assertEquals($cropY, $img->getCropY(), "CropY not correct."); $this->assertEquals($cropWidth, $img->getCropWidth(), "CropWidth not correct."); $this->assertEquals($cropHeight, $img->getCropHeight(), "CropHeight not correct."); } }