| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- /**
- * QREpsTest.php
- *
- * @created 16.03.2023
- * @author smiley <smiley@chillerlan.net>
- * @copyright 2023 smiley
- * @license MIT
- */
- namespace chillerlan\QRCodeTest\Output;
- use chillerlan\QRCode\QROptions;
- use chillerlan\QRCode\Data\QRMatrix;
- use chillerlan\QRCode\Output\{QREps, QROutputInterface};
- use chillerlan\Settings\SettingsContainerInterface;
- class QREpsTest extends QROutputTestAbstract{
- public static function moduleValueProvider():array{
- return [
- 'valid: 3 int' => [[123, 123, 123], true],
- 'valid: 4 int' => [[123, 123, 123, 123], true],
- 'valid: w/invalid extra element' => [[123, 123, 123, 123, 'abc'], true],
- 'valid: numeric string' => [['123', '123', '123'], true],
- 'invalid: wrong type' => ['foo', false],
- 'invalid: array too short' => [[1, 2], false],
- 'invalid: contains non-number' => [[1, 'b', 3], false],
- ];
- }
- protected function getOutputInterface(
- SettingsContainerInterface|QROptions $options,
- QRMatrix $matrix,
- ):QROutputInterface{
- return new QREps($options, $matrix);
- }
- public function testSetModuleValues():void{
- $this->options->moduleValues = [
- // data
- QRMatrix::M_DATA_DARK => [0, 0, 0],
- QRMatrix::M_DATA => [255, 255, 255],
- ];
- $this->outputInterface = $this->getOutputInterface($this->options, $this->matrix);
- $this->outputInterface->dump();
- /** @phpstan-ignore-next-line */
- $this::assertTrue(true); // tricking the code coverage
- }
- }
|