Permalink
Browse files

unit test for PubSub subcription records removal

  • Loading branch information...
1 parent 85be9d7 commit 0eae52d500369d72ea3a2599802f9ca961dfefa3 @quocvu committed Jan 9, 2013
@@ -286,14 +286,15 @@ public function testRespondsToValidConfirmationWith200Response()
'verify_token' => hash('sha256', 'cba'),
'created_time' => $t->getTimestamp(),
'lease_seconds' => 1234567,
- 'subscription_state'=> 'verified',
+ 'subscription_state'=> 'to_delete',
'expiration_time' => $t->add(new DateInterval('PT1234567S'))
->format('Y-m-d H:i:s'))),
$this->equalTo(array('id' => 'verifytokenkey'))
);
$this->_callback->handle($this->_get);
$this->assertTrue($this->_callback->getHttpResponse()->getStatusCode() == 200);
+ $this->assertTrue($this->_callback->getStorage()->hasSubscription('verifytokenkey') == false);
}
public function testRespondsToValidConfirmationWithBodyContainingHubChallenge()
@@ -97,6 +97,9 @@ public function testUnsubscriptionRequestSendsExpectedPostData()
.'%3A%2F%2Fwww.example.com%2Ftopic&hub.verify=sync&hub.verify=async'
.'&hub.verify_token=abc',
$this->client->getResponse()->getBody());
+
+ $subscriptionRecord = $this->subscriber->getStorage()->getSubscription();
+ $this->assertEquals($subscriptionRecord['subscription_state'], PubSubHubbub::SUBSCRIPTION_TODELETE);
}
protected function _getCleanMock($className)

0 comments on commit 0eae52d

Please sign in to comment.