Beispiel #1
0
 function testRadio()
 {
     $c = HTML::Radio('hello');
     $this->assertSelectCount('input[type=radio]', true, $c, 'Тип');
     $this->assertSelectCount('input[name=hello]', true, $c, 'Name');
     $this->assertSelectCount('input[value=1]', true, $c, 'Значение по-умолчанию');
     $this->assertSelectCount('input[checked=checked]', false, $c, 'Не отмечен');
     $c = HTML::Radio('hello', true, 123, 'myclass');
     $this->assertSelectCount('input[checked=checked]', true, $c, 'Отмечен');
     $this->assertSelectCount('input[value=123]', true, $c, 'Значение');
     $this->assertSelectCount('input[class=myclass]', true, $c, 'Класс');
     $c = HTML::Radio('hello', null, null, null, 'Привет');
     $this->assertSelectCount('label input', true, $c, 'Радиобатон завернутый в лейбл');
     $this->assertTrue(strpos($c, 'Привет') > 0, 'Текст лейбла');
 }