Repository navigation
Expand file tree
/
Copy pathRoutesCommandTest.php
More file actions
51 lines (39 loc) · 1.64 KB
/
Copy pathRoutesCommandTest.php
File metadata and controls
51 lines (39 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace Enqueue\Bundle\Tests\Functional;
use Enqueue\Symfony\Client\RoutesCommand;
use Symfony\Component\Console\Tester\CommandTester;
/**
* @group functional
*/
class RoutesCommandTest extends WebTestCase
{
public function testCouldBeGetFromContainerAsService()
{
$command = static::$container->get('test.enqueue.client.default.routes_command');
$this->assertInstanceOf(RoutesCommand::class, $command);
}
public function testShouldDisplayRegisteredTopics()
{
/** @var RoutesCommand $command */
$command = static::$container->get('test.enqueue.client.default.routes_command');
$tester = new CommandTester($command);
$tester->execute([]);
$expected = <<<'OUTPUT'
| topic | theTopic | default (prefixed) | test_topic_subscriber_processor | (hidden) |
OUTPUT;
$this->assertSame(0, $tester->getStatusCode());
$this->assertContains($expected, $tester->getDisplay());
}
public function testShouldDisplayCommands()
{
/** @var RoutesCommand $command */
$command = static::$container->get('test.enqueue.client.default.routes_command');
$tester = new CommandTester($command);
$tester->execute([]);
$expected = <<<'OUTPUT'
| command | theCommand | default (prefixed) | test_command_subscriber_processor | (hidden) |
OUTPUT;
$this->assertSame(0, $tester->getStatusCode());
$this->assertContains($expected, $tester->getDisplay());
}
}