:octocat: do not throw in QRDataModeInterface::validateString() (#182)

This commit is contained in:
smiley
2023-03-01 20:11:45 +01:00
parent d650fe7306
commit cc58c403f8
4 changed files with 39 additions and 4 deletions
+11
View File
@@ -16,6 +16,7 @@ use PHPUnit\Framework\TestCase;
use chillerlan\QRCode\Data\{Hanzi, QRCodeDataException, QRData, QRDataModeInterface, QRMatrix};
use ReflectionClass;
use function hex2bin;
use function str_repeat;
/**
@@ -98,6 +99,16 @@ abstract class DataInterfaceTestAbstract extends TestCase{
$this::assertSame($expected, $this->FQN::validateString($string));
}
/**
* Tests if a binary string is properly validated as false
*
* @see https://github.com/chillerlan/php-qrcode/issues/182
*/
public function testBinaryStringInvalid():void{
/** @noinspection PhpUndefinedMethodInspection */
$this::assertFalse($this->FQN::validateString(hex2bin('01015989f47dff8e852122117e04c90b9f15defc1c36477b1fe1')));
}
/**
* returns versions within the version breakpoints 1-9, 10-26 and 27-40
*/