mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 20:17:17 +00:00
added code length overflow exception
This commit is contained in:
+16
-2
@@ -71,10 +71,14 @@ class QRCodeTest extends \PHPUnit_Framework_TestCase{
|
||||
}
|
||||
}
|
||||
|
||||
public function testTypeAutoOverride(){
|
||||
/**
|
||||
* @dataProvider stringDataProvider
|
||||
*/
|
||||
public function testTypeAutoOverride($data){
|
||||
$this->options->typeNumber = QRCode::TYPE_05;
|
||||
new QRCode('foobar', new QRString, $this->options);
|
||||
new QRCode($data, new QRString, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \chillerlan\QRCode\QRCodeException
|
||||
* @expectedExceptionMessage No data given.
|
||||
@@ -92,4 +96,14 @@ class QRCodeTest extends \PHPUnit_Framework_TestCase{
|
||||
new QRCode('foobar', new QRString, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \chillerlan\QRCode\QRCodeException
|
||||
* @expectedExceptionMessage code length overflow. (261 > 72bit)
|
||||
*/
|
||||
public function testCodeLengthOverflowException(){
|
||||
$this->options->typeNumber = QRCode::TYPE_01;
|
||||
$this->options->errorCorrectLevel = QRCode::ERROR_CORRECT_LEVEL_H;
|
||||
(new QRCode('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 $%*+-./:', new QRString, $this->options))->getRawData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user