WarmupTest::itShouldFindAdviceAccordingToConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace Go\Zend\Framework\Tests\Functional;
4
5
use Go\Zend\Framework\Console\Command\WarmupCommand;
6
use PHPUnit\Framework\TestCase;
7
use Prophecy\Argument;
8
use Symfony\Component\Console\Input\ArgvInput;
9
use Symfony\Component\Console\Input\Input;
10
use Symfony\Component\Console\Input\InputArgument;
11
use Symfony\Component\Console\Input\InputDefinition;
12
use Symfony\Component\Console\Input\InputInterface;
13
use Symfony\Component\Console\Output\OutputInterface;
14
15
/**
16
 * @package Go\Zend\Framework\Tests\Functional
17
 */
18
class WarmupTest extends TestCase
19
{
20
    /**
21
     * @test
22
     */
23
    public function itShouldFindAdviceAccordingToConfig()
24
    {
25
        $input = $this->prophesize(InputInterface::class);
26
        $input->bind(Argument::any())->willReturn();
27
        $input->isInteractive()->willReturn(false);
28
        $input->hasArgument(Argument::any())->willReturn(false);
29
        $input->validate()->willReturn();
30
31
        $input->getArgument('applicationConfig')
32
            ->willReturn(__DIR__ . '/../resources/application_config.php');
33
34
        $output = $this->getMockBuilder(OutputInterface::class)
35
            ->setMethods(['writeln'])
36
            ->getMockForAbstractClass();
37
38
        $output->expects($this->at(1))
39
            ->method('writeln')
40
            ->with('Total <info>1</info> files to process.');
41
42
        $command = new WarmupCommand();
43
        $command->run($input->reveal(), $output);
44
    }
45
}