smiley 10 лет назад
Родитель
Сommit
fa9b108a2f
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      tests/QRCodeTest.php

+ 14 - 0
tests/QRCodeTest.php

@@ -12,6 +12,7 @@
 namespace chillerlan\QRCodeTest;
 namespace chillerlan\QRCodeTest;
 
 
 use chillerlan\QRCode\QRCode;
 use chillerlan\QRCode\QRCode;
+use chillerlan\QRCode\QRConst;
 use chillerlan\QRCode\QROptions;
 use chillerlan\QRCode\QROptions;
 use chillerlan\QRCode\Output\QRImage;
 use chillerlan\QRCode\Output\QRImage;
 use chillerlan\QRCode\Output\QRImageOptions;
 use chillerlan\QRCode\Output\QRImageOptions;
@@ -57,6 +58,19 @@ class QRCodeTest extends \PHPUnit_Framework_TestCase{
 		(new QRCode($data, new QRString))->getRawData();
 		(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(){
 	public function testTypeAutoOverride(){
 		$this->options->typeNumber = QRCode::TYPE_05;
 		$this->options->typeNumber = QRCode::TYPE_05;
 		new QRCode('foobar', new QRString, $this->options);
 		new QRCode('foobar', new QRString, $this->options);