1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-10 18:14:25 +02:00

major rearrange to prepare to move to PHP 5.4

This commit is contained in:
Mikael Roos
2015-12-05 14:50:49 +01:00
parent f9b149eb5d
commit 6a93f843be
24 changed files with 1137 additions and 915 deletions

View File

@@ -44,21 +44,21 @@ class CImageResizerStrategyKeepAspectRatioTest extends \PHPUnit_Framework_TestCa
*
* @return void
*/
public function testResize1($sw, $sh, $tw, $th, $twa, $tha, $cx, $cy, $cw, $ch)
{
$img = new CImageResizer(/*'logger'/**/);
public function testResize1($sw, $sh, $tw, $th, $twa, $tha, $cx, $cy, $cw, $ch)
{
$img = new CImageResizer(/*'logger'/**/);
$img->setSource($sw, $sh)
->setBaseWidthHeight($tw, $th)
->setResizeStrategy(CImageResizer::KEEP_RATIO)
->calculateTargetWidthAndHeight();
$img->setSource($sw, $sh)
->setBaseWidthHeight($tw, $th)
->setResizeStrategy(CImageResizer::KEEP_RATIO)
->calculateTargetWidthAndHeight();
$this->assertEquals($twa, $img->getTargetWidth(), "Target width not correct.");
$this->assertEquals($tha, $img->getTargetHeight(), "Target height not correct.");
$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.");
}
$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.");
}
}

View File

@@ -46,7 +46,7 @@ class CImageResizerStrategyStretchTest extends \PHPUnit_Framework_TestCase
*/
public function testResize1($sw, $sh, $tw, $th, $twa, $tha, $cx, $cy, $cw, $ch)
{
$img = new CImageResizer(/*'logger'/**/);
$img = new CImageResizer(/*'logger'/**/);
$img->setSource($sw, $sh)
->setBaseWidthHeight($tw, $th)

View File

@@ -21,7 +21,7 @@ class CImageResizerTest extends \PHPUnit_Framework_TestCase
// $strategy
// $srcWidth, $srcHeight, $targetWidth, $targetHeight,
// $aspectRatio, $dpr,
// $aspectRatio, $dpr,
// $expectedWidth, $expectedHeight,
// $expectedWidth2, $expectedHeight2
@@ -162,7 +162,7 @@ class CImageResizerTest extends \PHPUnit_Framework_TestCase
*/
public function testResizeStrategy($strategy, $str)
{
$img = new CImageResizer(/*'logger'*/);
$img = new CImageResizer(/*'logger'*/);
$img->setResizeStrategy($strategy);
$res = $img->getResizeStrategyAsString();

View File

@@ -38,7 +38,7 @@ class CImageSRGBTest extends \PHPUnit_Framework_TestCase
$img = new CImage();
$filename = $img->convert2sRGBColorSpace(
'car.png',
'car.png',
IMAGE_PATH,
$this->cache,
$this->srgbColorProfile
@@ -63,8 +63,8 @@ class CImageSRGBTest extends \PHPUnit_Framework_TestCase
$img = new CImage();
$filename = $img->convert2sRGBColorSpace(
'car.jpg',
IMAGE_PATH,
'car.jpg',
IMAGE_PATH,
$this->cache,
$this->srgbColorProfile
);