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:
@@ -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');
|
||||
|
||||
|
@@ -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');
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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.");
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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
54
test/CImgTest.php
Normal 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";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user