diff options
author | Andrew Dolgov <[email protected]> | 2021-02-26 19:16:17 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-26 19:16:17 +0300 |
commit | 3fd785654372d493c031d9b541ab33a881023a32 (patch) | |
tree | 0a76cb410217074378de3d7012b95754cd3c7e6f /vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php | |
parent | bc4475b6698f5a74e475674aa7af43253c459892 (diff) |
* switch to composer for qrcode and otp dependencies
* move most OTP-related stuff into userhelper
* remove old phpqrcode and otphp libraries
Diffstat (limited to 'vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php')
-rw-r--r-- | vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php b/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php new file mode 100644 index 000000000..7f6da303c --- /dev/null +++ b/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php @@ -0,0 +1,42 @@ +<?php +/** + * Class PolynomialTest + * + * @filesource PolynomialTest.php + * @created 09.02.2016 + * @package chillerlan\QRCodeTest\Helpers + * @author Smiley <[email protected]> + * @copyright 2015 Smiley + * @license MIT + */ + +namespace chillerlan\QRCodeTest\Helpers; + +use chillerlan\QRCode\Helpers\Polynomial; +use chillerlan\QRCode\QRCodeException; +use chillerlan\QRCodeTest\QRTestAbstract; + +class PolynomialTest extends QRTestAbstract{ + + /** + * @var \chillerlan\QRCode\Helpers\Polynomial + */ + protected $polynomial; + + protected function setUp():void{ + $this->polynomial = new Polynomial; + } + + public function testGexp(){ + $this->assertSame(142, $this->polynomial->gexp(-1)); + $this->assertSame(133, $this->polynomial->gexp(128)); + $this->assertSame(2, $this->polynomial->gexp(256)); + } + + public function testGlogException(){ + $this->expectException(QRCodeException::class); + $this->expectExceptionMessage('log(0)'); + + $this->polynomial->glog(0); + } +} |