1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-07 00:26:33 +02:00

made passing behat

This commit is contained in:
Mikael Roos
2017-03-03 22:53:29 +01:00
parent 0f0d954e61
commit 026e01b2cd
15 changed files with 180 additions and 98 deletions

View File

@@ -50,8 +50,15 @@ class CImageResizerByAspectRatioTest extends \PHPUnit_Framework_TestCase
*
* @return void
*/
public function testResize1($aspectRatio, $srcWidth, $srcHeight, $targetWidth, $targetHeight, $expectedWidth, $expectedHeight)
{
public function testResize1(
$aspectRatio,
$srcWidth,
$srcHeight,
$targetWidth,
$targetHeight,
$expectedWidth,
$expectedHeight
) {
$img = new CImageResizer(/*'logger'*/);
//$img = new CImageResizer('logger');

View File

@@ -50,8 +50,15 @@ class CImageResizerByDevicePixelRatioTest extends \PHPUnit_Framework_TestCase
*
* @return void
*/
public function testResize1($dpr, $srcWidth, $srcHeight, $targetWidth, $targetHeight, $expectedWidth, $expectedHeight)
{
public function testResize1(
$dpr,
$srcWidth,
$srcHeight,
$targetWidth,
$targetHeight,
$expectedWidth,
$expectedHeight
) {
$img = new CImageResizer(/*'logger'*/);
//$img = new CImageResizer('logger');

View File

@@ -107,7 +107,7 @@ class CImageResizerStrategyCropToFitTest extends \PHPUnit_Framework_TestCase
*/
public function testResize2($sw, $sh, $tw, $th, $cx, $cy, $cw, $ch, $dx, $dy, $dw, $dh)
{
$img = new CImageResizer(/*'logger'/**/);
$img = new CImageResizer(/*'logger'/**/);
$img->setSource($sw, $sh)
->setBaseWidthHeight($tw, $th)

View File

@@ -62,7 +62,6 @@ class CImageResizerStrategyFillToFitTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($dy, $img->getDestinationY(), "DestinationY not correct.");
$this->assertEquals($dw, $img->getDestinationWidth(), "DestinationWidth not correct.");
$this->assertEquals($dh, $img->getDestinationHeight(), "DestinationHeight not correct.");
}
@@ -116,6 +115,5 @@ class CImageResizerStrategyFillToFitTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($dy, $img->getDestinationY(), "DestinationY not correct.");
$this->assertEquals($dw, $img->getDestinationWidth(), "DestinationWidth not correct.");
$this->assertEquals($dh, $img->getDestinationHeight(), "DestinationHeight not correct.");
}
}

View File

@@ -53,6 +53,5 @@ class CImageResizerStrategyStretchTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($tw, $img->getTargetWidth(), "Target width not correct.");
$this->assertEquals($th, $img->getTargetHeight(), "Target height not correct.");
}
}

54
test/CImgTest.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
namespace Mos\CImage;
/**
* A testclass for img.php
*
*/
class CImgTest extends \PHPUnit_Framework_TestCase
{
/**
* Provider
*
* @return array
*/
public function providerQueryString()
{
return [
//
[[
"src" => "car.png",
"json" => true,
"rotate" => 90,
]],
];
}
/**
* Test
*
* @-preserveGlobalState disabled
* @runInSeparateProcess
*
* @dataProvider providerQueryString
*
* @return void
*/
public function testResize($query)
{
//$_GET = $query;
#ob_start();
//$res = require "webroot/img.php";
#$res = ob_get_clean();
//echo "MOPED $res";
}
}