/** * testAlreadySigned2 * * @expectedException OpenID_Association_Exception * @return void */ public function testAlreadySigned2() { $message = new OpenID_Message(); $message->set('openid.assoc_handle', 'foobar'); $message->set('openid.signed', '1234'); $this->object->signMessage($message); }
/** * testVerifySignature * * @return void */ public function testVerifySignature() { $opEndpoint = new OpenID_ServiceEndpoint(); $opEndpoint->setURIs(array($this->opEndpointURL)); $opEndpoints = new OpenID_ServiceEndpoints($this->claimedID, $opEndpoint); $this->discover = $this->getMock('OpenID_Discover', array('__get'), array($this->claimedID)); $this->discover->expects($this->once())->method('__get')->will($this->returnValue($opEndpoints)); $this->store->expects($this->once())->method('getDiscover')->will($this->returnValue($this->discover)); $this->store->expects($this->once())->method('getNonce')->will($this->returnValue(false)); $this->createObjects(); $association = new OpenID_Association(array('uri' => $this->opEndpointURL, 'expiresIn' => 600, 'created' => time(), 'assocType' => 'HMAC-SHA1', 'assocHandle' => '12345', 'sharedSecret' => '6789')); $this->message->set('openid.assoc_handle', '12345'); $association->signMessage($this->message); $this->assertTrue($this->assertion->verifySignature($association)); $this->message->set('openid.sig', 'foo'); $this->assertFalse($this->assertion->verifySignature($association)); }