RowsFieldUnitTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructor() 0 14 1
A testFillAllRow() 0 11 1
1
<?php
2
namespace Mezon\Gui\Field\Tests;
3
4
use PHPUnit\Framework\TestCase;
5
use Mezon\Gui\FormBuilder\RowsField;
6
7
/**
8
 *
9
 * @psalm-suppress PropertyNotSetInConstructor
10
 */
11
class RowsFieldUnitTest extends TestCase
12
{
13
14
    /**
15
     * Testing constructor
16
     */
17
    public function testConstructor(): void
18
    {
19
        // setupp
20
        $field = new RowsField([
21
            'title' => [
22
                'type' => 'string'
23
            ]
24
        ], 'author');
25
26
        // test bodyy
27
        $content = $field->html();
28
29
        // assertionss
30
        $this->assertStringContainsString('add_element_by_template', $content, 'Necessary JavaScripts were not found');
31
    }
32
33
    /**
34
     * Testing fillAllRow method
35
     */
36
    public function testFillAllRow(): void
37
    {
38
        // setupp
39
        $field = new \Mezon\Gui\FormBuilder\RowsField([
40
            'title' => [
41
                'type' => 'string'
42
            ]
43
        ], 'author');
44
45
        // test body and assertionss
46
        $this->assertTrue($field->fillAllRow());
47
    }
48
}
49