Doctrine\Tests\CouchDB\HTTP\SocketClientTestCase::testDeleteSingleDocumentFromDatabase PHP Method

testDeleteSingleDocumentFromDatabase() public method

    public function testDeleteSingleDocumentFromDatabase()
    {
        $db = new HTTP\SocketClient();
        $db->request('PUT', '/' . $this->getTestDatabase() . '/123', '{"_id":"123","data":"Foo"}');
        $response = $db->request('GET', '/' . $this->getTestDatabase() . '/123');
        $db->request('DELETE', '/' . $this->getTestDatabase() . '/123?rev=' . $response->body['_rev']);
        $response = $db->request('GET', '/' . $this->getTestDatabase() . '/123');
        $this->assertTrue($response instanceof HTTP\ErrorResponse);
        $this->assertSame(404, $response->status);
        $this->assertSame(array('error' => 'not_found', 'reason' => 'deleted'), $response->body);
    }