public function render() { return HTML::RadioListing($this->options, $this->getName(), $this->getTaintedValue(), $this->separator, $this->ignore_keys); }
function testRadioListing() { $arr = array(1 => 'one', 2 => 'two'); $l = HTML::RadioListing($arr, 'myname', 2); $this->assertSelectCount('label input[type=radio]', 2, $l, '2 радиобатона'); $this->assertSelectCount('label input[name=myname]', 2, $l, '2 радиобатона с именем'); $this->assertSelectCount('label input[checked=checked]', true, $l, '1 радиобатон отмечен'); $arr = array(0 => 'Нет', 1 => 'Да'); $l = HTML::RadioListing($arr, 'test'); $this->assertSelectCount('input[checked=checked]', false, $l, 'Ни один радиобатон не выбран'); $arr = array('one', 'two'); echo $l = HTML::RadioListing($arr, 'test', 'two', null, true); $this->assertSelectCount('input[value=one]', true, $l, 'Радиобатон с значением one'); $this->assertSelectCount('input[value=two]', true, $l, 'Радиобатон с значением two'); $this->assertSelectCount('input[checked=checked]', true, $l, 'Отмечен один чекбокс'); }