コード例 #1
0
ファイル: CouchDbTest.php プロジェクト: WarToaster/HangOn
 public function testResultClose()
 {
     $couchdb = new CouchDb($this->_testConfig);
     $result = $couchdb->result('close', (object) array(), $this->query);
     $this->assertNull($result);
 }
コード例 #2
0
 public function testRowsResult()
 {
     $couchdb = new CouchDb($this->_testConfig);
     $rows = (object) array('total_rows' => 11, 'offset' => 0, 'rows' => array((object) array('id' => 'a1', 'key' => null, 'value' => array('author' => 'author 1', 'body' => 'body 1')), (object) array('id' => 'a2', 'key' => null, 'value' => array('author' => 'author 2', 'body' => 'body 2')), (object) array('id' => 'a3', 'key' => null, 'value' => array('author' => 'author 3', 'body' => 'body 3'))));
     $expected = array('id' => 'a1', 'author' => 'author 1', 'body' => 'body 1');
     $result = $couchdb->result('next', $rows, $this->query);
     $this->assertEqual($expected, $result);
     $expected = array('id' => 'a2', 'author' => 'author 2', 'body' => 'body 2');
     $result = $couchdb->result('next', $rows, $this->query);
     $this->assertEqual($expected, $result);
 }