lithium\tests\cases\data\source\http\adapter\CouchDbTest::testEntityItem PHP Method

testEntityItem() public method

public testEntityItem ( )
    public function testEntityItem()
    {
        $couchdb = new CouchDb($this->_testConfig);
        $data = array('_id' => 'a1', '_rev' => '1-2', 'author' => 'author 1', 'body' => 'body 1');
        $expected = array('id' => 'a1', 'rev' => '1-2', 'author' => 'author 1', 'body' => 'body 1');
        $item = $couchdb->item($this->_query->model(), $data);
        $result = $item->data();
        $this->assertEqual($expected, $result);
        $data = array('author' => 'author 1', 'body' => 'body 1');
        $expected = array('author' => 'author 1', 'body' => 'body 1');
        $item = $couchdb->item($this->_query->model(), $data);
        $result = $item->data();
        $this->assertEqual($expected, $result);
    }