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

FormTypeExtensionBadTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 1
c 1
b 1
f 1
lcom 1
cbo 4
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testWrongFilterClassForFilterOption() 0 9 1
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\BadUser;
15
use Bukashk0zzz\FilterBundle\Tests\Fixtures\UserType;
16
17
/** @noinspection LongInheritanceChainInspection
18
 *
19
 * Test the FormTypeExtensionBadTest
20
 *
21
 * @author Denis Golubovskiy <[email protected]>
22
 *
23
 */
24
class FormTypeExtensionBadTest extends AbstractFormTypeExtension
25
{
26
    /**
27
     * Test annotation with wrong zend filter class for `filter` option
28
     *
29
     * @expectedException \InvalidArgumentException
30
     * @throws \Zend\Filter\Exception\RuntimeException If filtering $value is impossible
31
     * @throws \Zend\Filter\Exception\InvalidArgumentException
32
     * @throws \Symfony\Component\Form\Exception\AlreadySubmittedException
33
     * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
34
     */
35
    public function testWrongFilterClassForFilterOption()
36
    {
37
        $user = new BadUser();
38
        $form = $this->factory->create(UserType::class, $user, ['data_class' => 'Bukashk0zzz\FilterBundle\Tests\Fixtures\BadUser']);
39
        $form->submit([
40
            'name' => 'Test',
41
            'about' => 'Test',
42
        ]);
43
    }
44
}
45