Completed
Push — master ( 1c87cd...c75e6a )
by Alejandro
03:14
created

createAppThrowsExceptionIfInvalidConfigIsProvided()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace Acelaya\Test\Doctrine\Console;
3
4
use Acelaya\Doctrine\Console\ConsoleHelper;
5
use Acelaya\Doctrine\Exception\InvalidArgumentException;
6
use PHPUnit\Framework\TestCase;
7
use Prophecy\Argument;
8
use Symfony\Component\Console\Application;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class ConsoleHelperTest extends TestCase
12
{
13
    /**
14
     * @test
15
     */
16
    public function printConfigMissingErrorOutputsError()
17
    {
18
        $output = $this->prophesize(OutputInterface::class);
19
20
        ConsoleHelper::printConfigMissingError($output->reveal());
21
22
        $output->writeln(Argument::cetera())->shouldHaveBeenCalledTimes(3);
23
    }
24
25
    /**
26
     * @test
27
     */
28
    public function createAppReturnsApplication()
29
    {
30
        $app = ConsoleHelper::createApp(['enum_types' => []]);
31
32
        $this->assertInstanceOf(Application::class, $app);
33
        $this->assertTrue($app->has('det:dump-type-files'));
34
    }
35
36
    /**
37
     * @test
38
     */
39
    public function createAppThrowsExceptionIfInvalidConfigIsProvided()
40
    {
41
        $this->expectException(InvalidArgumentException::class);
42
        ConsoleHelper::createApp([]);
43
    }
44
}
45