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

testRadioGeneration() public method

public testRadioGeneration ( )
    public function testRadioGeneration()
    {
        $result = $this->form->radio('foo');
        $this->assertTags($result, array(array('input' => array('type' => 'radio', 'value' => '1', 'name' => 'foo', 'id' => 'Foo'))));
        $result = $this->form->radio('foo', array('checked' => false));
        $this->assertTags($result, array(array('input' => array('type' => 'radio', 'value' => '1', 'name' => 'foo', 'id' => 'Foo'))));
        $result = $this->form->radio('foo', array('checked' => true));
        $this->assertTags($result, array(array('input' => array('type' => 'radio', 'value' => '1', 'name' => 'foo', 'checked' => 'checked', 'id' => 'Foo'))));
        $record = new Record(array('model' => $this->_model, 'data' => array('foo' => true)));
        $this->form->create($record);
        $result = $this->form->radio('foo');
        $this->assertTags($result, array(array('input' => array('type' => 'radio', 'value' => '1', 'name' => 'foo', 'id' => 'MockFormPostFoo', 'checked' => 'checked'))));
        $record = new Record(array('model' => $this->_model, 'data' => array('foo' => false)));
        $this->form->create($record);
        $result = $this->form->radio('foo');
        $this->assertTags($result, array(array('input' => array('type' => 'radio', 'value' => '1', 'name' => 'foo', 'id' => 'MockFormPostFoo'))));
        $document = new Document(array('model' => $this->_model, 'data' => array('subdocument' => array('foo' => true))));
        $this->form->create($document);
        $result = $this->form->radio('subdocument.foo');
        $this->assertTags($result, array(array('input' => array('type' => 'radio', 'value' => '1', 'name' => 'subdocument[foo]', 'id' => 'MockFormPostSubdocumentFoo', 'checked' => 'checked'))));
    }
FormTest