mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-25 07:37:54 +00:00
:octocat: do not throw in QRDataModeInterface::validateString() (#182)
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user