Completed
Branch master (3b8125)
by
unknown
01:25
created

SimpleEntityGeneratorGenerateCommandTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace HelloWordPl\SimpleEntityGeneratorBundle\Tests\Command;
4
5
use HelloWordPl\SimpleEntityGeneratorBundle\Command\SimpleEntityGeneratorGenerateCommand;
6
use Symfony\Bundle\FrameworkBundle\Console\Application as App;
7
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
8
use Symfony\Component\Console\Tester\CommandTester;
9
10
/**
11
 * @author Sławomir Kania <[email protected]>
12
 */
13
class SimpleEntityGeneratorGenerateCommandTest extends WebTestCase
14
{
15
    private $application = null;
16
17
    public function setUp()
18
    {
19
        $kernel = $this->createKernel();
20
        $kernel->boot();
21
22
        $this->application = new App($kernel);
23
        $this->application->add(new SimpleEntityGeneratorGenerateCommand());
24
    }
25
26
    /**
27
     * @expectedException \Symfony\Component\Console\Exception\RuntimeException
28
     * @expectedExceptionMessage Not enough arguments (missing: "bundle_name, file_name")
29
     */
30
    public function testRunCommandWithoutArguments()
31
    {
32
        $command = $this->application->find('class_generator:generate');
33
        $commandTester = new CommandTester($command);
34
        $commandTester->execute(array('command' => $command->getName()));
35
    }
36
}
37