| @@ 15-37 (lines=23) @@ | ||
| 12 | /** |
|
| 13 | * @small |
|
| 14 | */ |
|
| 15 | final class ImageParserTest extends TestCase |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * @test |
|
| 19 | */ |
|
| 20 | public function parseArray(): void |
|
| 21 | { |
|
| 22 | $data = [ |
|
| 23 | "a.jpeg", |
|
| 24 | "b.png", |
|
| 25 | "c.gif", |
|
| 26 | ]; |
|
| 27 | ||
| 28 | $imageCollection = ImageParser::parseArray($data); |
|
| 29 | ||
| 30 | self::assertInstanceOf(ImageCollection::class, $imageCollection); |
|
| 31 | self::assertSame(count($data), count($imageCollection->getAll())); |
|
| 32 | ||
| 33 | foreach ($imageCollection->getAll() as $image) { |
|
| 34 | self::assertInstanceOf(Image::class, $image); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| @@ 15-37 (lines=23) @@ | ||
| 12 | /** |
|
| 13 | * @small |
|
| 14 | */ |
|
| 15 | final class ImageParserTest extends TestCase |
|
| 16 | { |
|
| 17 | /** |
|
| 18 | * @test |
|
| 19 | */ |
|
| 20 | public function parseArray(): void |
|
| 21 | { |
|
| 22 | $data = [ |
|
| 23 | "a.jpeg", |
|
| 24 | "b.png", |
|
| 25 | "c.gif", |
|
| 26 | ]; |
|
| 27 | ||
| 28 | $imageCollection = ImageParser::parseArray($data); |
|
| 29 | ||
| 30 | self::assertInstanceOf(ImageCollection::class, $imageCollection); |
|
| 31 | self::assertSame(count($data), count($imageCollection->getAll())); |
|
| 32 | ||
| 33 | foreach ($imageCollection->getAll() as $image) { |
|
| 34 | self::assertInstanceOf(Image::class, $image); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||