public function testInitializationWithNestedFields()
{
$doc = new Document(array('model' => $this->_model, 'data' => array('simple' => 'value', 'nested.foo' => 'first', 'nested.bar' => 'second', 'really.nested.key' => 'value')));
$this->assertEqual('value', $doc->simple);
$this->assertEqual('first', $doc->nested->foo);
$this->assertEqual('second', $doc->nested->bar);
$this->assertEqual('value', $doc->really->nested->key);
$result = array_keys($doc->data());
sort($result);
$this->assertEqual(array('nested', 'really', 'simple'), $result);
}