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

SimpleEntityGeneratorGenerateCommandTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 6
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A testRunCommandWithoutArguments() 0 6 1
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