php-simple-jwt/tests/JWTUtilTest.php

23 lines
477 B
PHP
Raw Normal View History

2021-02-11 13:22:51 +01:00
<?php
2023-04-09 02:40:21 +02:00
namespace NoccyLabs\SimpleJWT;
2021-02-11 13:22:51 +01:00
2023-04-09 02:40:21 +02:00
class JWTUtilTest extends \PHPUnit\Framework\TestCase
2021-02-11 13:22:51 +01:00
{
2023-04-09 02:40:21 +02:00
/**
2023-04-10 00:04:43 +02:00
* @covers \NoccyLabs\SimpleJWT\JWTUtil::encode
* @covers \NoccyLabs\SimpleJWT\JWTUtil::decode
2023-04-09 02:40:21 +02:00
*/
2021-02-11 13:22:51 +01:00
public function testTheEncodingShouldBeSymmetric()
{
$v1a = "HelloWorld";
2023-04-09 02:40:21 +02:00
$v1b = JWTUtil::encode($v1a);
$v1c = JWTUtil::decode($v1b);
2021-02-11 13:22:51 +01:00
$this->assertEquals($v1a, $v1c);
$this->assertNotEquals($v1a, $v1b);
}
2023-04-09 02:40:21 +02:00
}