MoneyTest::test_setValue_with_Money()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 1
eloc 9
c 2
b 1
f 1
nc 1
nop 0
dl 0
loc 13
rs 9.9666
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