lithium\tests\cases\data\entity\DocumentTest::testWithArraySchemaReusedName PHP Method

testWithArraySchemaReusedName() public method

    public function testWithArraySchemaReusedName()
    {
        $model = $this->_model;
        $schema = new DocumentSchema(array('fields' => array('_id' => array('type' => 'id'), 'bar' => array('array' => true), 'foo' => array('type' => 'object', 'array' => true), 'foo.foo' => array('type' => 'integer'), 'foo.bar' => array('type' => 'integer'))));
        $doc = new Document(compact('model', 'schema'));
        $doc->foo[] = array('foo' => 1, 'bar' => 100);
        $expected = array('foo' => array(array('foo' => 1, 'bar' => 100)));
        $this->assertEqual($expected, $doc->data());
    }