🛀 data mode rework

This commit is contained in:
codemasher
2020-11-21 02:43:14 +01:00
parent 4968063fb3
commit 9f5d0bc060
26 changed files with 853 additions and 789 deletions
+3 -12
View File
@@ -12,8 +12,7 @@
namespace chillerlan\QRCodeTest\Data;
use chillerlan\QRCode\Data\{AlphaNum, QRCodeDataException, QRDataInterface};
use chillerlan\QRCode\QROptions;
use chillerlan\QRCode\Data\{AlphaNum, QRCodeDataException};
/**
* Tests the AlphaNum class
@@ -21,7 +20,7 @@ use chillerlan\QRCode\QROptions;
final class AlphaNumTest extends DatainterfaceTestAbstract{
/** @internal */
protected string $testdata = '0 $%*+-./:';
protected array $testdata = [AlphaNum::class, '0 $%*+-./:'];
/** @internal */
protected array $expected = [
@@ -40,14 +39,6 @@ final class AlphaNumTest extends DatainterfaceTestAbstract{
92, 112, 20, 198, 27
];
/**
* @inheritDoc
* @internal
*/
protected function getDataInterfaceInstance(QROptions $options):QRDataInterface{
return new AlphaNum($options);
}
/**
* Tests if an exception is thrown when an invalid character is encountered
*/
@@ -55,7 +46,7 @@ final class AlphaNumTest extends DatainterfaceTestAbstract{
$this->expectException(QRCodeDataException::class);
$this->expectExceptionMessage('illegal char: "#" [35]');
$this->dataInterface->setData('#');
$this->dataInterface->setData([[AlphaNum::class, '#']]);
}
}