🚿 make data providers static (PHPUnit 10...)

This commit is contained in:
smiley
2023-03-09 23:38:20 +01:00
parent cf026a3eed
commit 43c49727f1
14 changed files with 25 additions and 25 deletions
+4 -4
View File
@@ -44,7 +44,7 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
$this->options->readerUseImagickIfAvailable = false;
}
public function qrCodeProvider():array{
public static function qrCodeProvider():array{
return [
'helloworld' => ['hello_world.png', 'Hello world!', false],
// covers mirroring
@@ -112,8 +112,8 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
$this::assertSame($numeric.$alphanum.$kanji.$hanzi.$byte, $result->data);
}
public function dataTestProvider():Generator{
$str = str_repeat($this::loremipsum, 5);
public static function dataTestProvider():Generator{
$str = str_repeat(self::loremipsum, 5);
$eccLevels = array_map(fn(int $ecc):EccLevel => new EccLevel($ecc), [EccLevel::L, EccLevel::M, EccLevel::Q, EccLevel::H]);
for($v = 1; $v <= 40; $v++){
@@ -123,7 +123,7 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
yield 'version: '.$version.$eccLevel => [
$version,
$eccLevel,
substr($str, 0, $this->getMaxLengthForMode(Mode::BYTE, $version, $eccLevel) ?? '')
substr($str, 0, self::getMaxLengthForMode(Mode::BYTE, $version, $eccLevel) ?? '')
];
}
}