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

FormTypeExtensionTest::testType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 11
rs 9.4285
cc 1
eloc 8
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 FormTypeExtension
20
 *
21
 * @author Denis Golubovskiy <[email protected]>
22
 *
23
 */
24
class FormTypeExtensionTest extends AbstractFormTypeExtension
25
{
26
    /**
27
     * Test form type extension
28
     * @throws \Symfony\Component\Form\Exception\AlreadySubmittedException
29
     * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
30
     */
31
    public function testType()
32
    {
33
        $user = new User();
34
        $form = $this->factory->create(UserType::class, $user);
35
        $form->submit([
36
            'name' => '     Test name <p>test</p> bla <br> bla',
37
            'about' => 'Test <p>about</p>     ',
38
        ]);
39
        static::assertSame('Test name test bla <br> bla', $user->getName());
40
        static::assertSame('Test about', $form->getData()->getAbout());
41
    }
42
}
43