|
@@ 45-58 (lines=14) @@
|
| 42 |
|
} |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function test_scale_down() { |
| 46 |
|
$scaler = new SizesScaler(new DefaultConfigurator([ |
| 47 |
|
'publicPath' => $this->publicPath, |
| 48 |
|
'includeSource' => false, |
| 49 |
|
])); |
| 50 |
|
$scaler->setSizes([500, 10000, 1920]); |
| 51 |
|
|
| 52 |
|
$sourceFile = $this->createSourceFile(); |
| 53 |
|
$imageObject = $this->createImageObject(); |
| 54 |
|
|
| 55 |
|
$sizes = $scaler->scale($sourceFile, $imageObject); |
| 56 |
|
|
| 57 |
|
$this->assertCount(2, $sizes); |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
public function test_scale_down_with_include_source() { |
| 61 |
|
$scaler = new SizesScaler(new DefaultConfigurator([ |
|
@@ 60-73 (lines=14) @@
|
| 57 |
|
$this->assertCount(2, $sizes); |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
public function test_scale_down_with_include_source() { |
| 61 |
|
$scaler = new SizesScaler(new DefaultConfigurator([ |
| 62 |
|
'publicPath' => $this->publicPath, |
| 63 |
|
'includeSource' => true, |
| 64 |
|
])); |
| 65 |
|
$scaler->setSizes([500, 800]); |
| 66 |
|
|
| 67 |
|
$sourceFile = $this->createSourceFile(); |
| 68 |
|
$imageObject = $this->createImageObject(); |
| 69 |
|
|
| 70 |
|
$sizes = $scaler->scale($sourceFile, $imageObject); |
| 71 |
|
|
| 72 |
|
$this->assertCount(3, $sizes); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
private function createImageObject() { |