Passed
Branch master (947605)
by smiley
03:06
created

PolynomialTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * @filesource   PolynomialTest.php
5
 * @created      09.02.2016
6
 * @package      chillerlan\QRCodeTest
7
 * @author       Smiley <[email protected]>
8
 * @copyright    2015 Smiley
9
 * @license      MIT
10
 */
11
12
namespace chillerlan\QRCodeTest;
13
14
use chillerlan\QRCode\Polynomial;
15
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