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

ButtonTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_render_attributes() 0 15 1
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