lithium\tests\cases\data\source\MongoDbTest::testCreateWithEmbeddedObjects PHP Method

testCreateWithEmbeddedObjects() public method

    public function testCreateWithEmbeddedObjects()
    {
        $data = array('_id' => new MongoId(), 'created' => new MongoDate(strtotime('-1 hour')), 'list' => array('foo', 'bar', 'baz'));
        $entity = new Document(compact('data') + array('exists' => false));
        $query = new Query(array('type' => 'create') + compact('entity'));
        $result = $query->export($this->_db);
        $this->assertIdentical($data, $result['data']['data']);
    }