Completed
Push — master ( a07def...5584d6 )
by Gabriel
04:52 queued 12s
created

ButtonTest::test_render_attributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 15
rs 9.9
1
<?php
2
3
namespace Nip\Form\Tests\Renderer\Buttons;
4
5
use Nip\Form\Form;
6
use Nip\Form\Tests\AbstractTest;
7
8
/**
9
 * Class ButtonTest
10
 * @package Nip\Form\Tests\Renderer\Buttons
11
 */
12
class ButtonTest extends AbstractTest
13
{
14
    public function test_render_attributes()
15
    {
16
        $button = new \Nip_Form_Button_Button(new Form());
17
        $button->setName('test');
18
        $button->setLabel('Label');
19
        $button->addAttribs([
20
            'value' => '5',
21
            'data-trigger' => 'form',
22
            'data-vendor' => 'foe',
23
        ]);
24
        $button->getRenderer();
25
26
        self::assertSame(
27
            '<button  class="btn btn-primary" type="submit" name="test" data-trigger="form" data-vendor="foe" title="Label">Label</button>',
28
            $button->getRenderer()->render()
29
        );
30
    }
31
}
32