Repository navigation
Expand file tree
/
Copy pathRoutesCommandTest.php
More file actions
51 lines (41 loc) · 1.91 KB
/
Copy pathRoutesCommandTest.php
File metadata and controls
51 lines (41 loc) · 1.91 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.routes_command');
$this->assertInstanceOf(RoutesCommand::class, $command);
}
public function testShouldDisplayRegisteredTopics()
{
/** @var RoutesCommand $command */
$command = static::$container->get('test.enqueue.client.routes_command');
$tester = new CommandTester($command);
$tester->execute([]);
$this->assertSame(0, $tester->getStatusCode());
$this->assertStringContainsString('| topic', $tester->getDisplay());
$this->assertStringContainsString('| theTopic', $tester->getDisplay());
$this->assertStringContainsString('| default (prefixed)', $tester->getDisplay());
$this->assertStringContainsString('| test_topic_subscriber_processor', $tester->getDisplay());
$this->assertStringContainsString('| (hidden)', $tester->getDisplay());
}
public function testShouldDisplayCommands()
{
/** @var RoutesCommand $command */
$command = static::$container->get('test.enqueue.client.routes_command');
$tester = new CommandTester($command);
$tester->execute([]);
$this->assertSame(0, $tester->getStatusCode());
$this->assertStringContainsString('| command', $tester->getDisplay());
$this->assertStringContainsString('| theCommand', $tester->getDisplay());
$this->assertStringContainsString('| test_command_subscriber_processor', $tester->getDisplay());
$this->assertStringContainsString('| default (prefixed)', $tester->getDisplay());
$this->assertStringContainsString('| (hidden)', $tester->getDisplay());
}
}