Extends
lithium\test\Unit
Tests that the `field()` method properly renders a `<select />` element if the `'list'`
option is passed.
Source
public function testFieldAssumeSelectIfList() {
$result = $this->form->field('colors', array(
'list' => array('r' => 'red', 'g' => 'green', 'b' => 'blue')
));
$expected = array(
'<div',
array('label' => array('for' => 'Colors')),
'Colors',
'/label',
'select' => array('name' => 'colors', 'id' => 'Colors'),
array('option' => array('value' => 'r')),
'red',
'/option',
array('option' => array('value' => 'g')),
'green',
'/option',
array('option' => array('value' => 'b')),
'blue',
'/option',
'/select',
'/div'
);
$this->assertTags($result, $expected);
}