|
@@ 49-62 (lines=14) @@
|
| 46 |
|
$this->assertEquals("image/jpeg", mime_content_type($destination)); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function testCreateImageWithScale() |
| 50 |
|
{ |
| 51 |
|
$style = [ |
| 52 |
|
'effect' => 'scale', |
| 53 |
|
'width' => 200, |
| 54 |
|
]; |
| 55 |
|
|
| 56 |
|
$destination = $this->generatedDirectory . 'dummy.jpg'; |
| 57 |
|
$this->imager->createImage($this->testImagePath, $destination, $style); |
| 58 |
|
|
| 59 |
|
$this->assertFileExists($destination); |
| 60 |
|
$this->assertEquals("image/jpeg", mime_content_type($destination)); |
| 61 |
|
$this->assertTrue(filesize($this->testImagePath) > filesize($destination)); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testCreateImageWithCrop() |
| 65 |
|
{ |
|
@@ 64-78 (lines=15) @@
|
| 61 |
|
$this->assertTrue(filesize($this->testImagePath) > filesize($destination)); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testCreateImageWithCrop() |
| 65 |
|
{ |
| 66 |
|
$style = [ |
| 67 |
|
'effect' => 'crop', |
| 68 |
|
'width' => 200, |
| 69 |
|
'height' => 200, |
| 70 |
|
]; |
| 71 |
|
|
| 72 |
|
$destination = $this->generatedDirectory . 'dummy.jpg'; |
| 73 |
|
$this->imager->createImage($this->testImagePath, $destination, $style); |
| 74 |
|
|
| 75 |
|
$this->assertFileExists($destination); |
| 76 |
|
$this->assertEquals("image/jpeg", mime_content_type($destination)); |
| 77 |
|
$this->assertTrue(filesize($this->testImagePath) > filesize($destination)); |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
public function testCreateImageWithCoordinates() |
| 81 |
|
{ |
|
@@ 80-94 (lines=15) @@
|
| 77 |
|
$this->assertTrue(filesize($this->testImagePath) > filesize($destination)); |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
public function testCreateImageWithCoordinates() |
| 81 |
|
{ |
| 82 |
|
$style = [ |
| 83 |
|
'effect' => 'crop', |
| 84 |
|
'width' => 200, |
| 85 |
|
'height' => 200, |
| 86 |
|
]; |
| 87 |
|
|
| 88 |
|
$destination = $this->generatedDirectory . 'dummy.jpg'; |
| 89 |
|
$this->imager->createImage($this->testImagePath, $destination, $style, $this->coordinates); |
| 90 |
|
|
| 91 |
|
$this->assertFileExists($destination); |
| 92 |
|
$this->assertEquals("image/jpeg", mime_content_type($destination)); |
| 93 |
|
$this->assertTrue(filesize($this->testImagePath) > filesize($destination)); |
| 94 |
|
} |
| 95 |
|
} |
| 96 |
|
|