From fa9b108a2f48912c68d7ffae44ddb6ba3a96c5e0 Mon Sep 17 00:00:00 2001 From: smiley Date: Tue, 9 Feb 2016 16:11:19 +0100 Subject: [PATCH] coverage, yes? --- tests/QRCodeTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/QRCodeTest.php b/tests/QRCodeTest.php index 0bfebc04f..b533a98dd 100644 --- a/tests/QRCodeTest.php +++ b/tests/QRCodeTest.php @@ -12,6 +12,7 @@ namespace chillerlan\QRCodeTest; use chillerlan\QRCode\QRCode; +use chillerlan\QRCode\QRConst; use chillerlan\QRCode\QROptions; use chillerlan\QRCode\Output\QRImage; use chillerlan\QRCode\Output\QRImageOptions; @@ -57,6 +58,19 @@ class QRCodeTest extends \PHPUnit_Framework_TestCase{ (new QRCode($data, new QRString))->getRawData(); } + /** + * @dataProvider stringDataProvider + */ + public function testTypeAndErrorcorrectlevelCoverage($data){ + foreach(QRConst::MAX_BITS as $type => $x){ + foreach(QRConst::RSBLOCK as $eclevel => $y){ + $this->options->typeNumber = $type; + $this->options->errorCorrectLevel = $eclevel; + $this->assertInstanceOf(QRCode::class, new QRCode($data, new QRString, $this->options)); + } + } + } + public function testTypeAutoOverride(){ $this->options->typeNumber = QRCode::TYPE_05; new QRCode('foobar', new QRString, $this->options);