mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-28 11:07:25 +00:00
:octocat: move Version::getMaxLengthForMode() and Version::MAX_LENGTH table to a trait in /tests
This commit is contained in:
@@ -24,6 +24,7 @@ use function range, sprintf, str_repeat, substr;
|
||||
* Tests the QR Code reader
|
||||
*/
|
||||
abstract class QRCodeReaderTestAbstract extends TestCase{
|
||||
use QRMaxLengthTrait;
|
||||
|
||||
// https://www.bobrosslipsum.com/
|
||||
protected const loremipsum = 'Just let this happen. We just let this flow right out of our minds. '
|
||||
@@ -111,7 +112,7 @@ abstract class QRCodeReaderTestAbstract extends TestCase{
|
||||
|
||||
foreach([EccLevel::L, EccLevel::M, EccLevel::Q, EccLevel::H] as $ecc){
|
||||
$eccLevel = new EccLevel($ecc);
|
||||
$expected = substr($str, 0, $version->getMaxLengthForMode(Mode::BYTE, $eccLevel) ?? '');
|
||||
$expected = substr($str, 0, $this->getMaxLengthForMode(Mode::BYTE, $version, $eccLevel) ?? '');
|
||||
|
||||
yield 'version: '.$version.$eccLevel => [$version, $eccLevel, $expected];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user