AbstractCommandTestCase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 41
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 15 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
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 WBW\Bundle\CoreBundle\Tests;
13
14
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
use Symfony\Component\Console\Style\StyleInterface;
18
19
/**
20
 * Abstract command test case.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Bundle\CoreBundle\Tests
24
 * @abstract
25
 */
26
abstract class AbstractCommandTestCase extends AbstractTestCase {
27
28
    /**
29
     * Input.
30
     *
31
     * @var InputInterface
32
     */
33
    protected $input;
34
35
    /**
36
     * Output.
37
     *
38
     * @var OutputInterface
39
     */
40
    protected $output;
41
42
    /**
43
     * Style.
44
     *
45
     * @var StyleInterface
46
     */
47
    protected $style;
48
49
    /**
50
     * {@inheritDoc}
51
     */
52
    protected function setUp(): void {
53
        parent::setUp();
54
55
        // Set an Output formatter mock.
56
        $outputFormatter = $this->getMockBuilder(OutputFormatterInterface::class)->getMock();
57
58
        // Set an Input mock.
59
        $this->input = $this->getMockBuilder(InputInterface::class)->getMock();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockBuilder(Sy...face::class)->getMock() of type PHPUnit\Framework\MockObject\MockObject is incompatible with the declared type Symfony\Component\Console\Input\InputInterface of property $input.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
60
61
        // Set an Output mock.
62
        $this->output = $this->getMockBuilder(OutputInterface::class)->getMock();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockBuilder(Sy...face::class)->getMock() of type PHPUnit\Framework\MockObject\MockObject is incompatible with the declared type Symfony\Component\Console\Output\OutputInterface of property $output.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
63
        $this->output->expects($this->any())->method("getFormatter")->willReturn($outputFormatter);
64
65
        // Set a Symfony style mock.
66
        $this->style = $this->getMockBuilder(StyleInterface::class)->getMock();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockBuilder(Sy...face::class)->getMock() of type PHPUnit\Framework\MockObject\MockObject is incompatible with the declared type Symfony\Component\Console\Style\StyleInterface of property $style.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
67
    }
68
}
69