diff options
Diffstat (limited to 'Tests/Auth/OpenID')
-rw-r--r-- | Tests/Auth/OpenID/Consumer.php | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/Tests/Auth/OpenID/Consumer.php b/Tests/Auth/OpenID/Consumer.php index fae98aa..fdb11f7 100644 --- a/Tests/Auth/OpenID/Consumer.php +++ b/Tests/Auth/OpenID/Consumer.php @@ -29,16 +29,23 @@ require_once 'Auth/OpenID/HMACSHA1.php'; require_once 'Tests/Auth/OpenID/MemStore.php'; require_once 'PHPUnit.php'; -class Auth_OpenID_TestConsumer extends Auth_OpenID_GenericConsumer { - /** - * Use a small (insecure) modulus for this test so that it runs quickly - */ - /* - function _createDiffieHellman() +class FastConsumerSession extends Auth_OpenID_DiffieHellmanSHA1ConsumerSession { + function FastConsumerSession($dh = null) { - return new Auth_OpenID_DiffieHellman('1235514290909'); + if ($dh === null) { + $dh = new Auth_OpenID_DiffieHellman(100389557, 2); + } + + $this->dh = $dh; } - */ +} + +function setConsumerSession(&$con) +{ + $con->session_types = array('DH-SHA1' => 'FastConsumerSession'); +} + +class Auth_OpenID_TestConsumer extends Auth_OpenID_GenericConsumer { } global $_Auth_OpenID_assocs; @@ -182,6 +189,8 @@ class Tests_Auth_OpenID_Consumer extends PHPUnit_TestCase { global $_Auth_OpenID_consumer_url, $_Auth_OpenID_server_url; + setConsumerSession($consumer); + $endpoint = new Auth_OpenID_ServiceEndpoint(); $endpoint->claimed_id = $user_url; $endpoint->server_url = $_Auth_OpenID_server_url; @@ -1917,22 +1926,6 @@ class DummyEndpoint { } } -class FastConsumerSession extends Auth_OpenID_DiffieHellmanSHA1ConsumerSession { - function FastConsumerSession($dh = null) - { - if ($dh === null) { - $dh = new Auth_OpenID_DiffieHellman(100389557, 2); - } - - $this->dh = $dh; - } -} - -function setConsumerSession(&$con) -{ - $con->session_types = array('DH-SHA1' => 'FastConsumerSession'); -} - class TestCreateAssociationRequest extends PHPUnit_TestCase { function setUp() { @@ -2137,4 +2130,4 @@ if (!defined('Auth_OpenID_NO_MATH_SUPPORT') && $Tests_Auth_OpenID_Consumer_other[] = new TestOpenID2SHA256(); } -?>
\ No newline at end of file +?> |