forked from Intervention/image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPolygonShapeTest.php
More file actions
32 lines (26 loc) · 961 Bytes
/
PolygonShapeTest.php
File metadata and controls
32 lines (26 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
use Intervention\Image\Gd\Shapes\PolygonShape as PolygonGd;
use Intervention\Image\Imagick\Shapes\PolygonShape as PolygonImagick;
class PolygonShapeTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
Mockery::close();
}
public function testGdConstructor()
{
$polygon = new PolygonGd(array(1, 2, 3, 4, 5, 6));
$this->assertInstanceOf('Intervention\Image\Gd\Shapes\PolygonShape', $polygon);
$this->assertEquals(array(1, 2, 3, 4, 5, 6), $polygon->points);
}
public function testImagickConstructor()
{
$polygon = new PolygonImagick(array(1, 2, 3, 4, 5, 6));
$this->assertInstanceOf('Intervention\Image\Imagick\Shapes\PolygonShape', $polygon);
$this->assertEquals(array(
array('x' => 1, 'y' => 2),
array('x' => 3, 'y' => 4),
array('x' => 5, 'y' => 6)),
$polygon->points);
}
}