Issues (138)

tests/Traits/NewElementsMethodsTest.php (1 issue)

Labels
Severity
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
'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