1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-22 13:32:56 +02:00

changed argument order of circle() and ellipse()

This commit is contained in:
Oliver Vogel
2014-05-18 11:50:32 +02:00
parent cca48626a7
commit b603d29ffd
6 changed files with 15 additions and 15 deletions

View File

@@ -14,9 +14,9 @@ class CircleCommand extends \Intervention\Image\Commands\AbstractCommand
*/ */
public function execute($image) public function execute($image)
{ {
$x = $this->argument(0)->type('numeric')->required()->value(); $radius = $this->argument(0)->type('numeric')->required()->value();
$y = $this->argument(1)->type('numeric')->required()->value(); $x = $this->argument(1)->type('numeric')->required()->value();
$radius = $this->argument(2)->type('numeric')->required()->value(); $y = $this->argument(2)->type('numeric')->required()->value();
$callback = $this->argument(3)->type('closure')->value(); $callback = $this->argument(3)->type('closure')->value();
$circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape', $circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape',

View File

@@ -14,10 +14,10 @@ class EllipseCommand extends \Intervention\Image\Commands\AbstractCommand
*/ */
public function execute($image) public function execute($image)
{ {
$x = $this->argument(0)->type('numeric')->required()->value(); $width = $this->argument(0)->type('numeric')->required()->value();
$y = $this->argument(1)->type('numeric')->required()->value(); $height = $this->argument(1)->type('numeric')->required()->value();
$width = $this->argument(2)->type('numeric')->value(10); $x = $this->argument(2)->type('numeric')->required()->value();
$height = $this->argument(3)->type('numeric')->value(10); $y = $this->argument(3)->type('numeric')->required()->value();
$callback = $this->argument(4)->type('closure')->value(); $callback = $this->argument(4)->type('closure')->value();
$ellipse_classname = sprintf('\Intervention\Image\%s\Shapes\EllipseShape', $ellipse_classname = sprintf('\Intervention\Image\%s\Shapes\EllipseShape',

View File

@@ -17,7 +17,7 @@ class CircleCommandTest extends PHPUnit_Framework_TestCase
$image = Mockery::mock('\Intervention\Image\Image'); $image = Mockery::mock('\Intervention\Image\Image');
$image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getDriver')->once()->andReturn($driver);
$image->shouldReceive('getCore')->once()->andReturn($resource); $image->shouldReceive('getCore')->once()->andReturn($resource);
$command = new CircleCommand(array(10, 20, 250)); $command = new CircleCommand(array(250, 10, 20));
$result = $command->execute($image); $result = $command->execute($image);
$this->assertTrue($result); $this->assertTrue($result);
$this->assertFalse($command->hasOutput()); $this->assertFalse($command->hasOutput());
@@ -33,7 +33,7 @@ class CircleCommandTest extends PHPUnit_Framework_TestCase
$image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getDriver')->once()->andReturn($driver);
$image->shouldReceive('getCore')->once()->andReturn($imagick); $image->shouldReceive('getCore')->once()->andReturn($imagick);
$command = new CircleCommand(array(10, 20, 250)); $command = new CircleCommand(array(25, 10, 20));
$result = $command->execute($image); $result = $command->execute($image);
$this->assertTrue($result); $this->assertTrue($result);
$this->assertFalse($command->hasOutput()); $this->assertFalse($command->hasOutput());

View File

@@ -17,7 +17,7 @@ class EllipseCommandTest extends PHPUnit_Framework_TestCase
$image = Mockery::mock('\Intervention\Image\Image'); $image = Mockery::mock('\Intervention\Image\Image');
$image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getDriver')->once()->andReturn($driver);
$image->shouldReceive('getCore')->once()->andReturn($resource); $image->shouldReceive('getCore')->once()->andReturn($resource);
$command = new EllipseCommand(array(10, 20, 250, 150)); $command = new EllipseCommand(array(250, 150, 10, 20));
$result = $command->execute($image); $result = $command->execute($image);
$this->assertTrue($result); $this->assertTrue($result);
$this->assertFalse($command->hasOutput()); $this->assertFalse($command->hasOutput());
@@ -33,7 +33,7 @@ class EllipseCommandTest extends PHPUnit_Framework_TestCase
$image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getDriver')->once()->andReturn($driver);
$image->shouldReceive('getCore')->once()->andReturn($imagick); $image->shouldReceive('getCore')->once()->andReturn($imagick);
$command = new EllipseCommand(array(10, 20, 250, 150)); $command = new EllipseCommand(array(250, 150, 10, 20));
$result = $command->execute($image); $result = $command->execute($image);
$this->assertTrue($result); $this->assertTrue($result);
$this->assertFalse($command->hasOutput()); $this->assertFalse($command->hasOutput());

View File

@@ -1002,14 +1002,14 @@ class GdSystemTest extends PHPUnit_Framework_TestCase
public function testEllipseImage() public function testEllipseImage()
{ {
$img = $this->manager()->canvas(16, 16, 'ffffff'); $img = $this->manager()->canvas(16, 16, 'ffffff');
$img->ellipse(8, 8, 12, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $img->ellipse(12, 8, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); });
$this->assertEquals('d56363fd454ad6e25a23c2a4a7c77998', $img->checksum()); $this->assertEquals('d56363fd454ad6e25a23c2a4a7c77998', $img->checksum());
} }
public function testCircleImage() public function testCircleImage()
{ {
$img = $this->manager()->canvas(16, 16, 'ffffff'); $img = $this->manager()->canvas(16, 16, 'ffffff');
$img->circle(8, 8, 12, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $img->circle(12, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); });
$this->assertEquals('c214f58de03d171f7f278a7b957bab50', $img->checksum()); $this->assertEquals('c214f58de03d171f7f278a7b957bab50', $img->checksum());
} }

View File

@@ -975,14 +975,14 @@ class ImagickSystemTest extends PHPUnit_Framework_TestCase
public function testEllipseImage() public function testEllipseImage()
{ {
$img = $this->manager()->canvas(16, 16, 'ffffff'); $img = $this->manager()->canvas(16, 16, 'ffffff');
$img->ellipse(8, 8, 12, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $img->ellipse(12, 8, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); });
$this->assertEquals('9dc5bbec6d45868610c082a1d67640b5', $img->checksum()); $this->assertEquals('9dc5bbec6d45868610c082a1d67640b5', $img->checksum());
} }
public function testCircleImage() public function testCircleImage()
{ {
$img = $this->manager()->canvas(16, 16, 'ffffff'); $img = $this->manager()->canvas(16, 16, 'ffffff');
$img->circle(8, 8, 12, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $img->circle(12, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); });
$this->assertEquals('a433c7c1a842ef83e1cb45875371358c', $img->checksum()); $this->assertEquals('a433c7c1a842ef83e1cb45875371358c', $img->checksum());
} }