| 1 | <?php |
||
| 16 | class PolynomialTest extends \PHPUnit_Framework_TestCase{ |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var \chillerlan\QRCode\Polynomial |
||
| 20 | */ |
||
| 21 | protected $polynomial; |
||
| 22 | |||
| 23 | protected function setUp(){ |
||
| 24 | $this->polynomial = new Polynomial; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function testGexp(){ |
||
| 28 | $this->assertEquals(142, $this->polynomial->gexp( -1)); |
||
| 29 | $this->assertEquals(133, $this->polynomial->gexp(128)); |
||
| 30 | $this->assertEquals(2, $this->polynomial->gexp(256)); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @expectedException \chillerlan\QRCode\QRCodeException |
||
| 35 | * @expectedExceptionMessage log(0) |
||
| 36 | */ |
||
| 37 | public function testGlogException(){ |
||
| 38 | $this->polynomial->glog(0); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |