Exemple #1
0
 public function testCurrentTimeSetterAndGetter()
 {
     $now = new DateTime();
     $subscription = new Subscription(new TableGateway('subscription', $this->initDb()));
     $subscription->setNow($now);
     $this->assertSame($subscription->getNow(), $now);
 }
 public function setUp()
 {
     $this->_callback = new CallbackSubscriber();
     $this->_adapter = $this->_getCleanMock('\\Zend\\Db\\Adapter\\Adapter');
     $this->_tableGateway = $this->_getCleanMock('\\Zend\\Db\\TableGateway\\TableGateway');
     $this->_rowset = $this->_getCleanMock('\\Zend\\Db\\ResultSet\\ResultSet');
     $this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));
     $storage = new Model\Subscription($this->_tableGateway);
     $this->now = new DateTime();
     $storage->setNow(clone $this->now);
     $this->_callback->setStorage($storage);
     $this->_get = array('hub_mode' => 'subscribe', 'hub_topic' => 'http://www.example.com/topic', 'hub_challenge' => 'abc', 'hub_verify_token' => 'cba', 'hub_lease_seconds' => '1234567');
     $_SERVER['REQUEST_METHOD'] = 'get';
     $_SERVER['QUERY_STRING'] = 'xhub.subscription=verifytokenkey';
 }