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

testFieldLabelWithOptions() public method

Demonstrates that the options for a element can be passed through the field() method, using the label text as a key.
    public function testFieldLabelWithOptions()
    {
        $result = $this->form->field('name', array('label' => array('Item Name' => array('class' => 'required'))));
        $this->assertTags($result, array('div' => array(), 'label' => array('for' => 'Name', 'class' => 'required'), 'Item Name', '/label', 'input' => array('type' => 'text', 'name' => 'name', 'id' => 'Name')));
        $result = $this->form->field('video_preview', array('label' => array('<a href="http://www.youtube.com/">Youtube</a>' => array('escape' => false))));
        $this->assertTags($result, array('div' => array(), 'label' => array('for' => 'VideoPreview'), 'a' => array('href' => 'http://www.youtube.com/'), 'Youtube', '/a', '/label', 'input' => array('type' => 'text', 'name' => 'video_preview', 'id' => 'VideoPreview')));
    }
FormTest