1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-25 23:06:13 +02:00

Switch test data providers to generators

This commit is contained in:
Oliver Vogel
2024-11-12 16:15:46 +01:00
parent f26e439d61
commit a5b1645002
17 changed files with 637 additions and 619 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Encoders;
use Generator;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use Intervention\Image\Encoders\PngEncoder;
@@ -48,49 +49,47 @@ final class PngEncoderTest extends GdTestCase
);
}
public static function indexedDataProvider(): array
public static function indexedDataProvider(): Generator
{
return [
[
static::createTestImage(3, 2), // new
new PngEncoder(indexed: false),
'truecolor-alpha',
],
[
static::createTestImage(3, 2), // new
new PngEncoder(indexed: true),
'indexed',
],
[
static::readTestImage('circle.png'), // truecolor-alpha
new PngEncoder(indexed: false),
'truecolor-alpha',
],
[
static::readTestImage('circle.png'), // indexedcolor-alpha
new PngEncoder(indexed: true),
'indexed',
],
[
static::readTestImage('tile.png'), // indexed
new PngEncoder(indexed: false),
'truecolor-alpha',
],
[
static::readTestImage('tile.png'), // indexed
new PngEncoder(indexed: true),
'indexed',
],
[
static::readTestImage('test.jpg'), // jpeg
new PngEncoder(indexed: false),
'truecolor-alpha',
],
[
static::readTestImage('test.jpg'), // jpeg
new PngEncoder(indexed: true),
'indexed',
],
yield [
static::createTestImage(3, 2), // new
new PngEncoder(indexed: false),
'truecolor-alpha',
];
yield [
static::createTestImage(3, 2), // new
new PngEncoder(indexed: true),
'indexed',
];
yield [
static::readTestImage('circle.png'), // truecolor-alpha
new PngEncoder(indexed: false),
'truecolor-alpha',
];
yield [
static::readTestImage('circle.png'), // indexedcolor-alpha
new PngEncoder(indexed: true),
'indexed',
];
yield [
static::readTestImage('tile.png'), // indexed
new PngEncoder(indexed: false),
'truecolor-alpha',
];
yield [
static::readTestImage('tile.png'), // indexed
new PngEncoder(indexed: true),
'indexed',
];
yield [
static::readTestImage('test.jpg'), // jpeg
new PngEncoder(indexed: false),
'truecolor-alpha',
];
yield [
static::readTestImage('test.jpg'), // jpeg
new PngEncoder(indexed: true),
'indexed',
];
}
}