MoneyTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_setValue_with_Money() 0 13 1
1
<?php
2
3
namespace Nip\Form\Tests\Elements;
4
5
use ByTIC\Money\Money;
6
use Nip\Form\Form;
7
use Nip\Form\Tests\AbstractTest;
8
use Nip_Form_Element_Money;
9
10
/**
11
 * Class DateinputTest
12
 * @package Nip\Form\Tests\Elements
13
 */
14
class MoneyTest extends AbstractTest
15
{
16
    public function test_setValue_with_Money()
17
    {
18
        $form = new Form();
19
        $form->setRendererType('Bootstrap4');
20
21
        $element = new Nip_Form_Element_Money($form);
22
        $value = Money::RON(223344);
23
        $element->setValue($value);
24
        $html = $form->getRenderer()->renderElement($element);
25
26
        self::assertSame(
27
            '<div class="input-group"><input  type="number" value="2233.44" class="form-control " title="" /><span class="input-group-text">RON</span></div>',
28
            $html
29
        );
30
    }
31
}
32