| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * Class QRCodeTest
- *
- * @created 17.11.2017
- * @author Smiley <smiley@chillerlan.net>
- * @copyright 2017 Smiley
- * @license MIT
- */
- namespace chillerlan\QRCodeTest;
- use chillerlan\QRCode\{QROptions, QRCode};
- use chillerlan\QRCode\Data\QRCodeDataException;
- use chillerlan\QRCode\Output\QRCodeOutputException;
- use PHPUnit\Framework\TestCase;
- /**
- * Tests basic functions of the QRCode class
- */
- final class QRCodeTest extends TestCase{
- private QRCode $qrcode;
- private QROptions $options;
- /**
- * invoke test instances
- */
- protected function setUp():void{
- $this->qrcode = new QRCode;
- $this->options = new QROptions;
- }
- /**
- * tests if an exception is thrown when an invalid (built-in) output type is specified
- */
- public function testInitOutputInterfaceException():void{
- $this->expectException(QRCodeOutputException::class);
- $this->expectExceptionMessage('invalid output type');
- $this->options->outputType = 'foo';
- (new QRCode($this->options))->render('test');
- }
- }
|