summaryrefslogtreecommitdiffstats
path: root/tests/JWTTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/JWTTest.php')
-rw-r--r--tests/JWTTest.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/JWTTest.php b/tests/JWTTest.php
index ae59455..42fb5f9 100644
--- a/tests/JWTTest.php
+++ b/tests/JWTTest.php
@@ -38,11 +38,9 @@ class JWTTest extends PHPUnit_Framework_TestCase
public function testExpiredToken()
{
$this->setExpectedException('ExpiredException');
- $timeInPast = time() - 20;
$payload = array(
"message" => "abc",
- "exp" => $timeInPast // time in the past
- );
+ "exp" => time() - 20); // time in the past
$encoded = JWT::encode($payload, 'my_key');
JWT::decode($encoded, 'my_key', array('HS256'));
}
@@ -50,11 +48,9 @@ class JWTTest extends PHPUnit_Framework_TestCase
public function testBeforeValidTokenWithNbf()
{
$this->setExpectedException('BeforeValidException');
- $timeInFuture = time() + 20;
$payload = array(
"message" => "abc",
- "nbf" => $timeInFuture // time in the future
- );
+ "nbf" => time() + 20); // time in the future
$encoded = JWT::encode($payload, 'my_key');
JWT::decode($encoded, 'my_key', array('HS256'));
}
@@ -62,11 +58,9 @@ class JWTTest extends PHPUnit_Framework_TestCase
public function testBeforeValidTokenWithIat()
{
$this->setExpectedException('BeforeValidException');
- $timeInFuture = time() + 20;
$payload = array(
"message" => "abc",
- "iat" => $timeInFuture // time in the future
- );
+ "iat" => time() + 20); // time in the future
$encoded = JWT::encode($payload, 'my_key');
JWT::decode($encoded, 'my_key', array('HS256'));
}