lithium\tests\cases\template\helper\FormTest::testSelectTypeAgnosticism PHP Метод

testSelectTypeAgnosticism() публичный Метод

When trying to determine which option of a select box should be selected, we should be integer/string agnostic because it all looks the same in HTML.
    public function testSelectTypeAgnosticism()
    {
        $taglist = array('select' => array('name' => 'numbers', 'id' => 'Numbers'), array('option' => array('value' => '0')), 'Zero', '/option', array('option' => array('value' => '1', 'selected' => 'selected')), 'One', '/option', array('option' => array('value' => '2')), 'Two', '/option', '/select');
        $result = $this->form->select('numbers', array(0 => 'Zero', 1 => 'One', 2 => 'Two'), array('id' => 'Numbers', 'value' => '1'));
        $this->assertTags($result, $taglist);
        $result = $this->form->select('numbers', array('0' => 'Zero', '1' => 'One', '2' => 'Two'), array('id' => 'Numbers', 'value' => 1));
        $this->assertTags($result, $taglist);
    }
FormTest