public function it_decodes_tokens() { $token = JWT::encode($payload = ['exp' => time() + 30, 'iat' => time(), 'nbf' => time(), 'context' => ['foo' => 'bar']], $secret = 'secret_123'); $driver = new FirebaseDriver(); $result = $driver->decodeToken($token, $secret); if ($result['exp'] !== $payload['exp'] || $result['iat'] !== $payload['iat'] || $result['nbf'] !== $payload['nbf'] || $result['context']['foo'] !== $payload['context']['foo']) { throw new \Exception('Decoded payload did not match the encoded tokens payload. ' . $token); } }