Passed
Push — master ( eb0fcb...47bdab )
by Gabriel
04:01 queued 10s
created

Bootstrap4Test   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRenderRow() 0 12 1
1
<?php
2
3
namespace Nip\Form\Tests\Renderer;
4
5
use Nip\Form\Form;
6
use Nip\Form\Tests\AbstractTest;
7
8
/**
9
 * Class Bootstrap4Test
10
 * @package Nip\Form\Tests\Renderer
11
 */
12
class Bootstrap4Test extends AbstractTest
13
{
14
    public function testRenderRow()
15
    {
16
        $form = new Form();
17
        $form->setRendererType('Bootstrap4');
18
        $form->add('test_input');
19
20
        self::assertSame(
21
            '<div class="form-group row-test_input">'
22
            .'<label class="col-form-label ">Test_input:</label>'
23
            .'<input  type="text" name="test_input" class="form-control " title="Test_input" />'
24
            .'</div>',
25
            $form->getRenderer()->renderRow($form->getElement('test_input'))
0 ignored issues
show
Bug introduced by
The method renderRow() does not exist on Nip_Form_Renderer_Basic. Did you maybe mean renderRows()? ( Ignorable by Annotation )

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

25
            $form->getRenderer()->/** @scrutinizer ignore-call */ renderRow($form->getElement('test_input'))

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
        );
27
    }
28
}
29