public function setUp()
{
$this->type = 'Doctrine\\Tests\\ODM\\CouchDB\\Functional\\Article';
$this->dm = $this->createDocumentManager();
$database = $this->dm->getDatabase();
$httpClient = $this->dm->getHttpClient();
$httpClient->request('DELETE', '/' . $database);
$resp = $httpClient->request('PUT', '/' . $database);
$this->assertEquals(201, $resp->status);
$data = json_encode(array('_id' => "1", 'title' => 'foo', 'body' => 'bar', 'type' => $this->type));
$resp = $httpClient->request('PUT', '/' . $database . '/1', $data);
$this->assertEquals(201, $resp->status);
$cmf = $this->dm->getClassMetadataFactory();
$metadata = new \Doctrine\ODM\CouchDB\Mapping\ClassMetadata($this->type);
$metadata->mapField(array('fieldName' => 'id', 'id' => true));
$metadata->mapField(array('fieldName' => 'title', 'type' => 'string'));
$metadata->mapField(array('fieldName' => 'body', 'type' => 'string'));
$metadata->idGenerator = \Doctrine\ODM\CouchDB\Mapping\ClassMetadata::IDGENERATOR_UUID;
$metadata->initializeReflection(new RuntimeReflectionService());
$metadata->wakeupReflection(new RuntimeReflectionService());
$cmf->setMetadataFor($this->type, $metadata);
}