diff options
Diffstat (limited to 'Tests/Auth/OpenID')
-rw-r--r-- | Tests/Auth/OpenID/AssociationResponse.php | 5 | ||||
-rw-r--r-- | Tests/Auth/OpenID/AuthRequest.php | 6 | ||||
-rw-r--r-- | Tests/Auth/OpenID/Consumer.php | 34 | ||||
-rw-r--r-- | Tests/Auth/OpenID/VerifyDisco.php | 2 |
4 files changed, 23 insertions, 24 deletions
diff --git a/Tests/Auth/OpenID/AssociationResponse.php b/Tests/Auth/OpenID/AssociationResponse.php index 714b27c..285577f 100644 --- a/Tests/Auth/OpenID/AssociationResponse.php +++ b/Tests/Auth/OpenID/AssociationResponse.php @@ -49,15 +49,14 @@ class Tests_Auth_OpenID_AssociationResponse extends PHPUnit_TestCase { function failUnlessProtocolError($thing) { - $this->assertTrue(is_a($thing, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($thing)); } function _run($keys) { $msg = mkAssocResponse($keys); $dumb = null; - $this->assertTrue(is_a($this->consumer->_extractAssociation($msg, $dumb), - 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($this->consumer->_extractAssociation($msg, $dumb))); } } diff --git a/Tests/Auth/OpenID/AuthRequest.php b/Tests/Auth/OpenID/AuthRequest.php index 629418f..3f67bbc 100644 --- a/Tests/Auth/OpenID/AuthRequest.php +++ b/Tests/Auth/OpenID/AuthRequest.php @@ -161,7 +161,7 @@ class TestAuthRequestOpenID2 extends TestAuthRequestMixin { { $result = $this->authreq->formMarkup($this->realm, null, true); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_markup_returnToArgs() @@ -169,7 +169,7 @@ class TestAuthRequestOpenID2 extends TestAuthRequestMixin { $this->authreq->return_to_args = array('extra' => 'args'); $result = $this->authreq->formMarkup($this->realm, null, false); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_setAnonymousWorksForOpenID2() @@ -247,7 +247,7 @@ class TestAuthRequestOpenID1 extends TestAuthRequestMixin { { $result = $this->authreq->formMarkup($this->realm, null, false); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_setAnonymousFailsForOpenID1() diff --git a/Tests/Auth/OpenID/Consumer.php b/Tests/Auth/OpenID/Consumer.php index 4e784e9..853e47b 100644 --- a/Tests/Auth/OpenID/Consumer.php +++ b/Tests/Auth/OpenID/Consumer.php @@ -508,7 +508,7 @@ class TestIdResCheckSignature extends _TestIdRes { { $this->message.setArg(Auth_OpenID_OPENID_NS, 'sig', 'BAD SIGNATURE'); $result = $this->consumer->_idResCheckSignature($this->message, $this->endpoint->server_url); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } } @@ -591,7 +591,7 @@ class Tests_Auth_OpenID_Stateless2 extends _TestIdRes { "dumbHandle"); $result = $this->consumer->_idResCheckSignature($this->message, $this->endpoint->server_url); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } } @@ -611,7 +611,7 @@ class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes { array('return_to' => $this->return_to)); $result = $this->consumer->_idResCheckNonce($this->response, $this->endpoint); - $this->assertFalse(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertFalse(Auth_OpenID::isFailure($result)); } function test_openid1Missing() @@ -631,7 +631,7 @@ class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes { array('return_to' => $this->return_to, 'ns' => Auth_OpenID_OPENID2_NS)); $result = $this->consumer->_idResCheckNonce($this->response, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_serverNonce() @@ -651,7 +651,7 @@ class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes { 'return_to'=> 'http://return.to/', 'response_nonce'=> Auth_OpenID_mkNonce())); $result = $this->consumer->_idResCheckNonce($this->response, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_badNonce() @@ -670,7 +670,7 @@ class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes { $result = $this->consumer->_idResCheckNonce($response, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_tamperedNonce() @@ -683,7 +683,7 @@ class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes { $result = $this->consumer->_idResCheckNonce($message, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_missingNonce() @@ -695,7 +695,7 @@ class Tests_Auth_OpenID_Consumer_CheckNonceTest extends _TestIdRes { $result = $this->consumer->_idResCheckNonce($message, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } } @@ -1056,7 +1056,7 @@ class TestReturnToArgs extends PHPUnit_TestCase { // no return value, success is assumed if there are no exceptions. $result = $this->consumer->_verifyReturnToArgs($query); - $this->assertFalse(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertFalse(Auth_OpenID::isFailure($result)); $this->assertTrue($result); } @@ -1068,19 +1068,19 @@ class TestReturnToArgs extends PHPUnit_TestCase { // fail, query has no key 'foo'. $result = $this->consumer->_verifyReturnToArgs($query); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); $query['foo'] = 'baz'; // fail, values for 'foo' do not match. $result = $this->consumer->_verifyReturnToArgs($query); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_noReturnTo() { $query = array('openid.mode'=> 'id_res'); $result = $this->consumer->_verifyReturnToArgs($query); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_completeBadReturnTo() @@ -1112,7 +1112,7 @@ class TestReturnToArgs extends PHPUnit_TestCase { foreach ($bad_return_tos as $bad) { $m->setArg(Auth_OpenID_OPENID_NS, 'return_to', $bad); $result = $this->consumer->complete($m, $endpoint, $return_to); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); $this->assertTrue($result->message == "openid.return_to does not match return URL"); } @@ -1814,7 +1814,7 @@ class IDPDrivenTest extends PHPUnit_TestCase { 'openid.sig'=> $GOODSIG)); $result = $this->consumer->_doIdRes($message, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function failUnlessSuccess($response) @@ -1879,7 +1879,7 @@ class TestDiscoveryVerification extends PHPUnit_TestCase { $result = $this->consumer->_verifyDiscoveryResults( $this->message, $endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_foreignDelegate() @@ -1893,7 +1893,7 @@ class TestDiscoveryVerification extends PHPUnit_TestCase { $result = $this->consumer->_verifyDiscoveryResults( $this->message, $endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } function test_nothingDiscovered() @@ -1902,7 +1902,7 @@ class TestDiscoveryVerification extends PHPUnit_TestCase { $this->services = array(); $result = $this->consumer->_verifyDiscoveryResults( $this->message, $this->endpoint); - $this->assertTrue(is_a($result, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($result)); } } diff --git a/Tests/Auth/OpenID/VerifyDisco.php b/Tests/Auth/OpenID/VerifyDisco.php index 4d62e35..e4ed3ce 100644 --- a/Tests/Auth/OpenID/VerifyDisco.php +++ b/Tests/Auth/OpenID/VerifyDisco.php @@ -30,7 +30,7 @@ class Tests_Auth_OpenID_VerifyDisco extends OpenIDTestMixin { function failUnlessProtocolError($thing) { - $this->assertTrue(is_a($thing, 'Auth_OpenID_FailureResponse')); + $this->assertTrue(Auth_OpenID::isFailure($thing)); } function test_openID1NoLocalID() |