RunCommandTest::testExecute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Loevgaard\CronBundle\Tests\Command;
4
5
use Loevgaard\CronBundle\Command\RunCommand;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\Console\Application;
8
use Symfony\Component\Console\Tester\CommandTester;
9
10
class RunCommandTest extends TestCase
11
{
12
    public function testExecute()
13
    {
14
        /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
15
        $command = new RunCommand();
16
17
        $application = new Application();
18
        $application->setAutoExit(false);
19
        $application->add($command);
20
21
        $command = $application->find('loevgaard:cron:run');
22
        $commandTester = new CommandTester($command);
23
        $exitCode = $commandTester->execute([
24
            'command' => $command->getName(),
25
        ]);
26
27
        $this->assertSame(0, $exitCode, 'Returns 0 in case of success');
28
        */
29
    }
30
}
31