Completed
Push — master ( 30bfa2...7adf0d )
by Bukashk0zzz
02:13
created

FormTypeExtensionWithoutFilterTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the FilterBundle
5
 *
6
 * (c) Denis Golubovskiy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bukashk0zzz\FilterBundle\Tests\Form;
13
14
use Bukashk0zzz\FilterBundle\Tests\Fixtures\User;
15
use Bukashk0zzz\FilterBundle\Tests\Fixtures\UserType;
16
17
/** @noinspection LongInheritanceChainInspection
18
 *
19
 * Test the FormTypeExtensionWithoutFilterTest
20
 *
21
 * @author Denis Golubovskiy <[email protected]>
22
 *
23
 */
24
class FormTypeExtensionWithoutFilterTest extends AbstractFormTypeExtension
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function setUp()
30
    {
31
        $this->autoFilter = false;
32
        parent::setUp();
33
    }
34
35
    /**
36
     * Test form type extension without filter
37
     * @throws \Symfony\Component\Form\Exception\AlreadySubmittedException
38
     * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
39
     */
40
    public function testTypeWithoutFilter()
41
    {
42
        $user = new User();
43
        $this->autoFilter = false;
44
        $form = $this->factory->create(UserType::class, $user);
45
        $form->submit([
46
            'name' => 'Test name <p>test</p>',
47
            'about' => 'Test <p>about</p>',
48
        ]);
49
        static::assertSame('Test name <p>test</p>', $user->getName());
50
        static::assertSame('Test <p>about</p>', $form->getData()->getAbout());
51
    }
52
}
53