public function testUpdateWithEmbeddedObjects()
{
$data = array('_id' => new MongoId(), 'created' => new MongoDate(strtotime('-1 hour')), 'list' => array('foo', 'bar', 'baz'));
$fields = array('updated' => array('type' => 'MongoDate'));
$schema = new Schema(compact('fields'));
$entity = new Document(compact('data', 'schema', 'model') + array('exists' => true));
$entity->updated = time();
$entity->list[] = 'dib';
$query = new Query(array('type' => 'update') + compact('entity'));
$result = $query->export($this->_db);
$expected = array('_id', 'created', 'list', 'updated');
$this->assertEqual($expected, array_keys($result['data']['update']));
$this->assertInstanceOf('MongoDate', $result['data']['update']['updated']);
}