Completed
Push — master ( a5a753...454108 )
by Wachter
07:05
created

ScheduleSystemTasksCommandTest::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Task\TaskBundle\Functional\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Task\TaskBundle\Tests\Functional\BaseCommandTestCase;
7
8
class ScheduleSystemTasksCommandTest extends BaseCommandTestCase
9
{
10
    public function setUp()
11
    {
12
        self::bootKernel();
13
        if (self::$kernel->getContainer()->getParameter('kernel.storage') !== 'doctrine') {
14
            return $this->markTestSkipped('This testcase will only be called for doctrine storage.');
15
        }
16
17
        parent::setUp();
18
    }
19
20
    public function testExecute()
21
    {
22
        $this->commandTester->execute(
23
            [
24
                'command' => $this->command->getName(),
25
            ]
26
        );
27
28
        $output = $this->commandTester->getDisplay();
29
        $this->assertContains('System-tasks successfully scheduled', $output);
30
31
        $taskRepository = self::$kernel->getContainer()->get('task.repository.task');
32
        $this->assertNotNull($taskRepository->findBySystemKey('testing'));
33
    }
34
35
    /**
36
     * Returns command.
37
     *
38
     * @return Command
39
     */
40
    protected function getCommand()
41
    {
42
        return self::$kernel->getContainer()->get('task.command.schedule_system_tasks');
43
    }
44
}
45