8000 Add tests · symfony/symfony@266c273 · GitHub
[go: up one dir, main page]

Skip to content

Commit 266c273

Browse files
committed
Add tests
1 parent 2f3f28c commit 266c273

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Messenger\Tests\Command;
13+
14+
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\DependencyInjection\ServiceLocator;
16+
use Symfony\Component\Messenger\Command\ConsumeMessagesCommand;
17+
use Symfony\Component\Messenger\MessageBus;
18+
19+
class ConsumeMessagesCommandTest extends TestCase
20+
{
21+
public function testConfigurationWithDefaultReceiver()
22+
{
23+
$command = new ConsumeMessagesCommand($this->createMock(MessageBus::class), $this->createMock(ServiceLocator::class), null, 'messenger.transport.amqp');
24+
$inputArgument = $command->getDefinition()->getArgument('receiver');
25+
$this->assertFalse($inputArgument->isRequired());
26+
$this->assertSame('messenger.transport.amqp', $inputArgument->getDefault());
27+
}
28+
29+
public function testConfigurationWithoutDefaultReceiver()
30+
{
31+
$command = new ConsumeMessagesCommand($this->createMock(MessageBus::class), $this->createMock(ServiceLocator::class));
32+
$inputArgument = $command->getDefinition()->getArgument('receiver');
33+
$this->assertTrue($inputArgument->isRequired());
34+
$this->assertNull($inputArgument->getDefault());
35+
}
36+
}

0 commit comments

Comments
 (0)
0