@@ -23,23 +23,23 @@ |
||
| 23 | 23 | $this->privateKey = 'privateKey'; |
| 24 | 24 | $this->reflector = new \ReflectionClass(HashHmac::class); |
| 25 | 25 | $this->data = ['foo' => 'bar']; |
| 26 | - $this->hmac = new HashHmac($this->privateKey,$this->algo); |
|
| 26 | + $this->hmac = new HashHmac($this->privateKey, $this->algo); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function testHash() |
| 30 | 30 | { |
| 31 | 31 | $actual = $this->hmac->create($this->data); |
| 32 | 32 | $token = base64_decode($actual); |
| 33 | - $tokenParts = explode('=',$token); |
|
| 33 | + $tokenParts = explode('=', $token); |
|
| 34 | 34 | $tokenHash = $tokenParts[1]; |
| 35 | - $expected = hash_hmac($this->algo, json_encode($this->data) , $this->privateKey); |
|
| 35 | + $expected = hash_hmac($this->algo, json_encode($this->data), $this->privateKey); |
|
| 36 | 36 | $this->assertEquals($tokenHash, $expected); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function testCompareHash() |
| 40 | 40 | { |
| 41 | 41 | $encodedHash = $this->hmac->create($this->data); |
| 42 | - $this->assertEquals(true, $this->hmac->verify($encodedHash,$this->data)); |
|
| 42 | + $this->assertEquals(true, $this->hmac->verify($encodedHash, $this->data)); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function testCompareHashInvalidAlgo() |