1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-04 18:59:14 +00:00

* switch to composer for qrcode and otp dependencies

* move most OTP-related stuff into userhelper
* remove old phpqrcode and otphp libraries
This commit is contained in:
Andrew Dolgov
2021-02-26 19:16:17 +03:00
parent bc4475b669
commit 3fd7856543
788 changed files with 63185 additions and 11711 deletions

View File

@@ -0,0 +1,42 @@
<?php
/**
* Class PolynomialTest
*
* @filesource PolynomialTest.php
* @created 09.02.2016
* @package chillerlan\QRCodeTest\Helpers
* @author Smiley <smiley@chillerlan.net>
* @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);
}
}