for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Eljam\GuzzleJwt\Tests;
use Eljam\GuzzleJwt\JwtToken;
class JwtTokenTest extends \PHPUnit_Framework_TestCase
{
public function testTokenShouldNotBeValidIfExpirationIsInThePast()
$token = new JwtToken('foo', new \DateTime('now - 5 minutes'));
$this->assertFalse($token->isValid());
}
public function testTokenShouldNotBeValidIfExpirationIsNow()
$token = new JwtToken('foo', new \DateTime('now'));
public function testTokenShouldBeValidIfExpirationIsInTheFuture()
$token = new JwtToken('foo', new \DateTime('now + 5 minutes'));
$this->assertTrue($token->isValid());