Ejemplo n.º 1
0
 /**
  * @covers mychaelstyle\datastore\providers\AmazonDynamoDB::write
  * @covers mychaelstyle\datastore\providers\AmazonDynamoDB::batchWrite
  * @covers mychaelstyle\datastore\providers\AmazonDynamoDB::get
  * @covers mychaelstyle\datastore\providers\AmazonDynamoDB::batchGet
  * @covers mychaelstyle\datastore\providers\AmazonDynamoDB::connect
  */
 public function testFlow()
 {
     $t = time();
     $expected = array('tests' => array(array('id' => 'AAAA0001', 'updated_at' => (int) $t, 'body' => 'This is test!')));
     // write
     $this->object->write('tests', $expected['tests'][0]);
     // get
     $result = $this->object->get('tests', array('id' => 'AAAA0001'));
     $this->assertEquals($expected['tests'][0], $result);
     // remove
     $this->object->remove('tests', array('id' => 'AAAA0001'));
     $result = $this->object->get('tests', array('id' => 'AAAA0001'));
     $this->assertNull($result);
     // batch write
     $this->object->batchWrite($expected);
     // batchGet
     $result = $this->object->batchGet(array('tests' => array(array('id' => 'AAAA0001'))));
     $this->assertEquals($expected, $result);
     // batch remove
     $result = $this->object->batchRemove(array('tests' => array(array('id' => 'AAAA0001'))));
     $result = $this->object->get('tests', array('id' => 'AAAA0001'));
     $this->assertNull($result);
 }