RadioGroupTest::testRenderEmptyElement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 2
b 0
f 2
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Form\Tests\Elements;
4
5
use Nip\Form\Tests\AbstractTest;
6
7
/**
8
 * Class RadioGroupTest
9
 * @package Nip\Form\Tests\Elements
10
 */
11
class RadioGroupTest extends AbstractTest
12
{
13
    public function testRenderEmptyElement()
14
    {
15
        $input = new \Nip_Form_Element_RadioGroup(new \Nip\Form\Form());
16
        $html = $input->render();
17
18
        self::assertSame('', $html);
19
    }
20
21
    public function testAutoSelectFirstDefaultDoesNotChangeValue()
22
    {
23
        $input = new \Nip_Form_Element_RadioGroup(new \Nip\Form\Form());
24
        $input->addOption('123', 'Age');
25
        $input->addOption('789', 'Height');
26
        $input->autoSelectFirst(true);
27
28
        self::assertSame(null, $input->getValue());
29
30
        $input->render();
31
        self::assertSame(null, $input->getValue());
32
    }
33
}
34