setSource($sw, $sh) ->setBaseWidthHeight($tw, $th) ->setResizeStrategy(CImageResizer::STRETCH) ->calculateTargetWidthAndHeight(); $this->assertEquals($twa, $img->getTargetWidth(), "Target width not correct."); $this->assertEquals($tha, $img->getTargetHeight(), "Target height not correct."); $this->assertEquals($cx, $img->getCropX(), "CropX not correct."); $this->assertEquals($cy, $img->getCropY(), "CropY not correct."); $this->assertEquals($cw, $img->getCropWidth(), "CropWidth not correct."); $this->assertEquals($ch, $img->getCropHeight(), "CropHeight not correct."); } }