Issues (138)

tests/FormTest.php (1 issue)

1
<?php
2
3
namespace Nip\Form\Tests;
4
5
use Nip_Form as Form;
6
use Nip_Form_Element_Select as Select;
7
use Nip_Form_Element_MultiSelect as MultiSelect;
8
use Nip_Form_Renderer_Bootstrap;
9
use Nip_Form_Renderer_Bootstrap4;
10
use Nip_Form_Renderer_Table;
11
12
/**
13
 * Class FormTest
14
 * @package Nip\Tests\Form
15
 */
16
class FormTest extends AbstractTest
17
{
18
    /**
19
     * @var Form
20
     */
21
    protected $object;
22
23
    /**
24
     * @dataProvider rendererTypeProvider
25
     * @param string $type
26
     * @param string $class
27
     */
28
    public function testSetRendererType($type, $class)
29
    {
30
        $this->object->setRendererType($type);
31
32
        $renderer = $this->object->getRenderer();
33
        self::assertInstanceOf($class, $renderer);
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    public function rendererTypeProvider()
40
    {
41
        return [
42
            ['table', Nip_Form_Renderer_Table::class],
43
            ['bootstrap', Nip_Form_Renderer_Bootstrap::class],
44
            ['bootstrap4', Nip_Form_Renderer_Bootstrap4::class],
45
        ];
46
    }
47
48
    protected function setUp(): void
49
    {
50
        parent::setUp();
51
        $this->object = new Form();
0 ignored issues
show
Deprecated Code introduced by
The class Nip_Form has been deprecated: Use Nip\Form\Form ( Ignorable by Annotation )

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

51
        $this->object = /** @scrutinizer ignore-deprecated */ new Form();
Loading history...
52
    }
53
}
54