diff options
author | tailor <cygnus@janrain.com> | 2006-04-19 22:47:23 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-04-19 22:47:23 +0000 |
commit | bc4ddc20f020b1d79aa57ba8326be646203b985f (patch) | |
tree | 795777c903794d524122028df52da0040d9ae343 /Tests | |
parent | 94525f21f2c507b9c10e8180ce6de4667f5e66a5 (diff) | |
download | php-openid-bc4ddc20f020b1d79aa57ba8326be646203b985f.zip php-openid-bc4ddc20f020b1d79aa57ba8326be646203b985f.tar.gz php-openid-bc4ddc20f020b1d79aa57ba8326be646203b985f.tar.bz2 |
[project @ Removed more DH tests from server lineup when no bigmath found]
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Auth/OpenID/Server.php | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php index 34cfce6..80e6b4c 100644 --- a/Tests/Auth/OpenID/Server.php +++ b/Tests/Auth/OpenID/Server.php @@ -345,14 +345,16 @@ class Tests_Auth_OpenID_Test_Encode extends PHPUnit_TestCase { function test_assocReply() { - $request = new Auth_OpenID_AssociateRequest(); - $response = new Auth_OpenID_ServerResponse($request); - $response->fields = array('assoc_handle' => "every-zig"); - $webresponse = $this->encoder->encode($response); - $body = "assoc_handle:every-zig\n"; - $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK); - $this->assertEquals($webresponse->headers, array()); - $this->assertEquals($webresponse->body, $body); + if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) { + $request = new Auth_OpenID_AssociateRequest(); + $response = new Auth_OpenID_ServerResponse($request); + $response->fields = array('assoc_handle' => "every-zig"); + $webresponse = $this->encoder->encode($response); + $body = "assoc_handle:every-zig\n"; + $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK); + $this->assertEquals($webresponse->headers, array()); + $this->assertEquals($webresponse->body, $body); + } } function test_checkauthReply() @@ -497,15 +499,17 @@ class Tests_Auth_OpenID_SigningEncode extends PHPUnit_TestCase { function test_assocReply() { - $request = new Auth_OpenID_AssociateRequest(); - $response = new Auth_OpenID_ServerResponse($request); - $response->fields = array('assoc_handle' => "every-zig"); - $webresponse = $this->encoder->encode($response); - $body = "assoc_handle:every-zig\n"; - - $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK); - $this->assertEquals($webresponse->headers, array()); - $this->assertEquals($webresponse->body, $body); + if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) { + $request = new Auth_OpenID_AssociateRequest(); + $response = new Auth_OpenID_ServerResponse($request); + $response->fields = array('assoc_handle' => "every-zig"); + $webresponse = $this->encoder->encode($response); + $body = "assoc_handle:every-zig\n"; + + $this->assertEquals($webresponse->code, AUTH_OPENID_HTTP_OK); + $this->assertEquals($webresponse->headers, array()); + $this->assertEquals($webresponse->body, $body); + } } function test_alreadySigned() @@ -948,10 +952,12 @@ class Tests_Auth_OpenID_ServerTest extends PHPUnit_TestCase { function test_associate() { - $request = new Auth_OpenID_AssociateRequest(); - $response = $this->server->openid_associate($request); - $this->assertTrue(array_key_exists('assoc_handle', - $response->fields)); + if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) { + $request = new Auth_OpenID_AssociateRequest(); + $response = $this->server->openid_associate($request); + $this->assertTrue(array_key_exists('assoc_handle', + $response->fields)); + } } function test_checkAuth() @@ -1233,7 +1239,9 @@ class Tests_Auth_OpenID_Server extends PHPUnit_TestSuite { { $this->addTestSuite('Tests_Auth_OpenID_Signatory'); $this->addTestSuite('Tests_Auth_OpenID_ServerTest'); - $this->addTestSuite('Tests_Auth_OpenID_Associate'); + if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) { + $this->addTestSuite('Tests_Auth_OpenID_Associate'); + } $this->addTestSuite('Tests_Auth_OpenID_CheckAuth'); $this->addTestSuite('Tests_Auth_OpenID_CheckIDExtension'); $this->addTestSuite('Tests_Auth_OpenID_CheckAuth'); |