RadioGroupTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 2
eloc 11
dl 0
loc 21
rs 10
c 2
b 0
f 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAutoSelectFirstDefaultDoesNotChangeValue() 0 11 1
A testRenderEmptyElement() 0 6 1
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