From b12a1d84df218dafaca7ccedffd9efeb3b0bd73d Mon Sep 17 00:00:00 2001 From: Joseph Deray Date: Tue, 11 Mar 2014 12:41:21 -0400 Subject: [PATCH] added the ability to change the algorithm used to generate the token strings. added files missing in last commit --- .../Util/KeyAlgorithm/DefaultAlgorithm.php | 35 +++++++++++++++++++ .../KeyAlgorithm/KeyAlgorithmInterface.php | 15 ++++++++ .../key_algorithm/DefaultAlgorithmTest.php | 24 +++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/League/OAuth2/Server/Util/KeyAlgorithm/DefaultAlgorithm.php create mode 100644 src/League/OAuth2/Server/Util/KeyAlgorithm/KeyAlgorithmInterface.php create mode 100644 tests/util/key_algorithm/DefaultAlgorithmTest.php diff --git a/src/League/OAuth2/Server/Util/KeyAlgorithm/DefaultAlgorithm.php b/src/League/OAuth2/Server/Util/KeyAlgorithm/DefaultAlgorithm.php new file mode 100644 index 00000000..9fc6c653 --- /dev/null +++ b/src/League/OAuth2/Server/Util/KeyAlgorithm/DefaultAlgorithm.php @@ -0,0 +1,35 @@ +make(); + $v2 = $algorithm->make(); + $v3 = $algorithm->make(50); + + $this->assertEquals(40, strlen($v1)); + $this->assertTrue($v1 !== $v2); + $this->assertEquals(50, strlen($v3)); + } +} \ No newline at end of file