Skip to content

Commit bcf8460

Browse files
committed
ShutdownHandler test
1 parent 9f8f25c commit bcf8460

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace ApiClients\Tests\Supervisord\CommandBus\Handler;
4+
5+
use ApiClients\Client\Supervisord\CommandBus\Command\ShutdownCommand;
6+
use ApiClients\Client\Supervisord\CommandBus\Handler\ShutdownHandler;
7+
use ApiClients\Tools\Services\XmlRpc\XmlRpcService;
8+
use ApiClients\Tools\TestUtilities\TestCase;
9+
use function React\Promise\resolve;
10+
11+
final class ShutdownHandlerTest extends TestCase
12+
{
13+
public function testCommand()
14+
{
15+
$service = $this->prophesize(XmlRpcService::class);
16+
$service->call('supervisor.shutdown')->shouldBeCalled()->willReturn(resolve(true));
17+
18+
$handler = new ShutdownHandler($service->reveal());
19+
$result = $this->await($handler->handle(new ShutdownCommand()));
20+
21+
self::assertTrue($result);
22+
}
23+
}

0 commit comments

Comments
 (0)