lithium\tests\cases\template\helper\FormTest::testNestedFieldAccess PHP Method

testNestedFieldAccess() public method

Tests that inputs for nested objects can be assigned using dot syntax.
    public function testNestedFieldAccess()
    {
        $doc = new Document(array('data' => array('foo' => array('bar' => 'value'))));
        $this->form->create($doc);
        $result = $this->form->text('foo.bar');
        $this->assertTags($result, array('input' => array('type' => 'text', 'name' => 'foo[bar]', 'id' => 'FooBar', 'value' => 'value')));
        $result = $this->form->field('foo.bar');
        $this->assertTags($result, array('div' => array(), 'label' => array('for' => 'FooBar'), 'Foo Bar', '/label', 'input' => array('type' => 'text', 'name' => 'foo[bar]', 'id' => 'FooBar', 'value' => 'value')));
    }
FormTest