mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-27 23:40:22 +05:30
30 lines
670 B
PHP
30 lines
670 B
PHP
<?php
|
|
|
|
namespace LeagueTests\Utils;
|
|
|
|
use League\OAuth2\Server\CryptKey;
|
|
use LeagueTests\Stubs\CryptTraitStub;
|
|
|
|
class CryptTraitTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var \LeagueTests\Stubs\CryptTraitStub
|
|
*/
|
|
protected $cryptStub;
|
|
|
|
public function setUp()
|
|
{
|
|
$this->cryptStub = new CryptTraitStub;
|
|
}
|
|
|
|
public function testEncryptDecrypt()
|
|
{
|
|
$payload = 'alex loves whisky';
|
|
$encrypted = $this->cryptStub->doEncrypt($payload);
|
|
$plainText = $this->cryptStub->doDecrypt($encrypted);
|
|
|
|
$this->assertNotEquals($payload, $encrypted);
|
|
$this->assertEquals($payload, $plainText);
|
|
}
|
|
}
|