Example #1
0
 /**
  * @group ZF-10069
  */
 public function testAllOperations()
 {
     $this->_initDb();
     $subscription = new Subscription();
     $id = uniqid();
     $this->assertFalse($subscription->hasSubscription($id));
     $this->assertFalse($subscription->getSubscription($id));
     $this->assertFalse($subscription->deleteSubscription($id));
     $this->assertTrue($subscription->setSubscription(array('id' => $id)));
     $this->assertTrue($subscription->hasSubscription($id));
     $dataSubscription = $subscription->getSubscription($id);
     $this->assertType('array', $dataSubscription);
     $keys = array('id', 'topic_url', 'hub_url', 'created_time', 'lease_seconds', 'verify_token', 'secret', 'expiration_time', 'subscription_state');
     $this->assertSame($keys, array_keys($dataSubscription));
     $this->assertFalse($subscription->setSubscription(array('id' => $id)));
     $this->assertTrue($subscription->deleteSubscription($id));
 }
Example #2
0
 /**
  * @group ZF-10069
  */
 public function testAllOperations()
 {
     $this->markTestIncomplete('PDO_Sqlite does not return row count, and no solution in Zend\\Db yet for this');
     $adapter = $this->initDb();
     $table = new TableGateway('subscription', $adapter);
     $subscription = new Subscription($table);
     $id = uniqid();
     $this->assertFalse($subscription->hasSubscription($id));
     $this->assertFalse($subscription->getSubscription($id));
     $this->assertFalse($subscription->deleteSubscription($id));
     $this->assertTrue($subscription->setSubscription(array('id' => $id)));
     $this->assertTrue($subscription->hasSubscription($id));
     $dataSubscription = $subscription->getSubscription($id);
     $this->assertInternalType('array', $dataSubscription);
     $keys = array('id', 'topic_url', 'hub_url', 'created_time', 'lease_seconds', 'verify_token', 'secret', 'expiration_time', 'subscription_state');
     $this->assertSame($keys, array_keys($dataSubscription));
     $this->assertFalse($subscription->setSubscription(array('id' => $id)));
     $this->assertTrue($subscription->deleteSubscription($id));
 }