Completed
Push — master ( ae5e03...0447ee )
by Jeroen
10:35 queued 04:37
created

Tests/unit/Form/PagePartAdminTypeTestCase.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\PagePartBundle\Tests\unit\Form;
4
5
use Kunstmaan\NodeBundle\Form\Type\URLChooserType;
6
use Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser;
7
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
8
use Symfony\Component\EventDispatcher\EventDispatcher;
9
use Symfony\Component\Form\FormBuilder;
10
use Symfony\Component\Form\Forms;
11
use Symfony\Component\OptionsResolver\OptionsResolver;
12
13
/**
14
 * PagePartAdminTypeTestCase
15
 */
16 View Code Duplication
class PagePartAdminTypeTestCase extends WebTestCase
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    /**
19
     * @var FormBuilder
20
     */
21
    protected $builder;
22
23
    /**
24
     * @var EventDispatcher
25
     */
26
    protected $dispatcher;
27
28
    /**
29
     * @var \Symfony\Component\Form\FormFactoryInterface
30
     */
31
    protected $factory;
32
33
    /**
34
     * @var OptionsResolver
35
     */
36
    protected $resolver;
37
38
    /**
39
     * Sets up the fixture, for example, opens a network connection.
40
     * This method is called before a test is executed.
41
     */
42
    protected function setUp()
43
    {
44
        $formFactoryBuilderInterface = Forms::createFormFactoryBuilder();
45
        $formFactoryBuilderInterface->addType(new URLChooserType());
46
        $formFactoryBuilderInterface->addTypeGuesser(new DoctrineOrmTypeGuesser($this->createMock('Doctrine\Common\Persistence\ManagerRegistry')));
47
        $this->factory = $formFactoryBuilderInterface->getFormFactory();
48
        $this->dispatcher = $this->createMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
49
        $this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
50
        $this->resolver = new OptionsResolver();
51
    }
52
}
53