| @@ 66-76 (lines=11) @@ | ||
| 63 | $this->assertTrue(count($sizes) > 1); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function test_scale_down_with_max_width() { |
|
| 67 | $sourceFile = $this->createSourceFile(); |
|
| 68 | $imageObject = $this->createImageObject(); |
|
| 69 | ||
| 70 | $this->scaler->setMaxWidth(1000); |
|
| 71 | $sizes = $this->scaler->scale($sourceFile, $imageObject); |
|
| 72 | ||
| 73 | foreach ($sizes as $width => $height) { |
|
| 74 | $this->assertTrue($width < 1000); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | public function test_scale_down_with_max_filesize() { |
|
| 79 | $sourceFile = $this->createSourceFile(); |
|
| @@ 68-78 (lines=11) @@ | ||
| 65 | $this->assertTrue(count($sizes) > 1); |
|
| 66 | } |
|
| 67 | ||
| 68 | public function test_scale_down_with_max_width() { |
|
| 69 | $sourceFile = $this->createSourceFile(); |
|
| 70 | $imageObject = $this->createImageObject(); |
|
| 71 | ||
| 72 | $this->scaler->setMaxWidth(1000); |
|
| 73 | $sizes = $this->scaler->scale($sourceFile, $imageObject); |
|
| 74 | ||
| 75 | foreach ($sizes as $width => $height) { |
|
| 76 | $this->assertTrue($width < 1000); |
|
| 77 | } |
|
| 78 | } |
|
| 79 | ||
| 80 | private function createSourceFile() { |
|
| 81 | $sourceFiles = Finder::create()->files()->in('./tests/img')->name('image.jpeg')->getIterator(); |
|