create() public method

Create new document.
public create ( string $query, array $options = [] ) : boolean
$query string
$options array
return boolean
コード例 #1
0
 public function testCreateWithId()
 {
     $couchdb = new CouchDb($this->_testConfig);
     $this->query->data(array('id' => 12345, 'name' => 'Acme Inc.'));
     $expected = true;
     $result = $couchdb->create($this->query);
     $this->assertEqual($expected, $result);
     $expected = '/posts/12345';
     $result = $couchdb->last->request->path;
     $this->assertEqual($expected, $result);
     $expected = array();
     $result = $couchdb->last->request->params;
     $this->assertEqual($expected, $result);
 }