Passed
Push — master ( a22205...112e67 )
by Gabriel
04:04 queued 13s
created

NewElementsMethodsTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_add_with_options() 0 7 1
1
<?php
2
3
namespace Nip\Form\Tests\Traits;
4
5
use Nip\Form\Form;
6
use Nip\Form\Tests\AbstractTest;
7
8
/**
9
 * Class NewElementsMethodsTest
10
 * @package Nip\Form\Tests\Traits
11
 */
12
class NewElementsMethodsTest extends AbstractTest
13
{
14
    public function test_add_with_options()
15
    {
16
        $form = new Form();
17
        $form->add('test', 'label', 'input', true, ['value' => 5]);
0 ignored issues
show
Bug introduced by
'label' of type string is incompatible with the type boolean expected by parameter $label of Nip\Form\AbstractForm::add(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
        $form->add('test', /** @scrutinizer ignore-type */ 'label', 'input', true, ['value' => 5]);
Loading history...
18
19
        $element = $form->getElement('test');
20
        self::assertSame(['value' => 5], $element->getOptions());
21
    }
22
}
23