function testSelect() { $s = HTML::Select(HTML::Option('hello'), 'myname'); $this->assertSelectCount('select[name=myname] option[value=hello]', true, $s, 'Простой селект'); $s = HTML::Select(array(1 => 'Привет', 2 => 'Пока'), 'hello', 2, 'myclass', 'Выбор'); $this->assertSelectCount('select[class=myclass]', true, $s, 'Атрибуты'); $this->assertGreaterThan(0, strpos($s, '<option value="">Выбор</option>'), 'Заголовок'); $this->assertGreaterThan(0, strpos($s, '<option value="1">Привет</option>'), 'Первый пункт не выбран'); $this->assertGreaterThan(0, strpos($s, '<option selected="selected" value="2">Пока</option>'), 'Второй пункт выбран'); }