AbstractTypeTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 1
getTestedInstance() 0 1 ?
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Tests\Form\Type;
15
16
use Sonata\MediaBundle\Provider\MediaProviderInterface;
17
use Sonata\MediaBundle\Provider\Pool;
18
use Symfony\Component\Form\FormBuilder;
19
use Symfony\Component\Form\FormTypeInterface;
20
use Symfony\Component\Form\Test\TypeTestCase;
21
22
/**
23
 * @author Virgile Vivier <[email protected]>
24
 */
25
abstract class AbstractTypeTest extends TypeTestCase
26
{
27
    /**
28
     * @var FormBuilder
29
     */
30
    protected $formBuilder;
31
32
    /**
33
     * @var FormTypeInterface
34
     */
35
    protected $formType;
36
37
    /**
38
     * @var Pool
39
     */
40
    protected $mediaPool;
41
42
    protected function setUp(): void
43
    {
44
        $provider = $this->createMock(MediaProviderInterface::class);
45
46
        $this->mediaPool = $this->createMock(Pool::class);
47
        $this->mediaPool->method('getProvider')->willReturn($provider);
48
49
        $this->formType = $this->getTestedInstance();
50
    }
51
52
    abstract protected function getTestedInstance(): FormTypeInterface;
53
}
54