public function testKeepTrackOfUnmappedData()
{
$httpClient = $this->dm->getHttpClient();
$data = array('_id' => "2", 'username' => 'beberlei', 'email' => '[email protected]', 'address' => array('city' => 'Bonn', 'country' => 'DE'), 'type' => str_replace("\\", ".", $this->type));
$resp = $httpClient->request('PUT', '/' . $this->dm->getDatabase() . '/2', json_encode($data));
$this->assertEquals(201, $resp->status);
$user = $this->dm->find($this->type, 2);
$this->assertInstanceOf($this->type, $user);
$this->assertEquals('beberlei', $user->username);
$user->username = 'beberlei2';
$this->dm->flush();
$resp = $httpClient->request('GET', '/' . $this->dm->getDatabase() . '/2');
$this->assertEquals(200, $resp->status);
$data['username'] = 'beberlei2';
ksort($resp->body);
ksort($data);
unset($resp->body['_rev']);
$this->assertEquals($data, $resp->body);
}