mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
added the ability to change the algorithm used to generate the token strings. added files missing in last commit
This commit is contained in:
24
tests/util/key_algorithm/DefaultAlgorithmTest.php
Normal file
24
tests/util/key_algorithm/DefaultAlgorithmTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: jderay
|
||||
* Date: 3/11/14
|
||||
* Time: 12:31 PM
|
||||
*/
|
||||
|
||||
use League\OAuth2\Server\Util\KeyAlgorithm\DefaultAlgorithm;
|
||||
|
||||
class Default_Algorithm_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function test_make()
|
||||
{
|
||||
$algorithm = new League\OAuth2\Server\Util\KeyAlgorithm\DefaultAlgorithm();
|
||||
$v1 = $algorithm->make();
|
||||
$v2 = $algorithm->make();
|
||||
$v3 = $algorithm->make(50);
|
||||
|
||||
$this->assertEquals(40, strlen($v1));
|
||||
$this->assertTrue($v1 !== $v2);
|
||||
$this->assertEquals(50, strlen($v3));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user