From 3d9bd0ab1f738e354bd9c420c9564f5d4500c93c Mon Sep 17 00:00:00 2001 From: Luis Miguel Cabral Date: Mon, 11 May 2015 12:32:11 +0200 Subject: Reverted some tests from first commit --- tests/JWTTest.php | 12 +++--------- 1 file 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')); } -- cgit v1.1