Lines Matching +full:check +full:- +full:attr
14 $form->addRadioButton('foo', 'label text first')->val('first')->attr('checked', 'checked');
15 $form->addRadioButton('foo', 'label text second')->val('second');
17 $html = $form->toHTML();
18 $pq = (new Document())->html($html);
20 $input = $pq->find('input[name=foo]');
21 $this->assertTrue($input->count() == 2);
23 $label = $pq->find('label');
24 $this->assertTrue($label->count() == 2);
26 $inputs = $pq->find('input[name=foo]');
27 $this->assertEquals('first', $inputs->get(0)->attr('value'));
28 $this->assertEquals('second', $inputs->get(1)->attr('value'));
29 $this->assertEquals('checked', $inputs->get(0)->attr('checked'));
30 $this->assertEquals('', $inputs->get(1)->attr('checked'));
31 $this->assertEquals('radio', $inputs->get(0)->attr('type'));
35 * check that posted values overwrite preset default
40 $INPUT->post->set('foo', 'second');
43 $form->addRadioButton('foo', 'label text first')->val('first')->attr('checked', 'checked');
44 $form->addRadioButton('foo', 'label text second')->val('second');
46 $html = $form->toHTML();
47 $pq = (new Document())->html($html);
49 $inputs = $pq->find('input[name=foo]');
50 $this->assertEquals('first', $inputs->get(0)->attr('value'));
51 $this->assertEquals('second', $inputs->get(1)->attr('value'));
52 $this->assertEquals('', $inputs->get(0)->attr('checked'));
53 $this->assertEquals('checked', $inputs->get(1)->attr('checked'));
54 $this->assertEquals('radio', $inputs->get(0)->attr('type'));