public function testApiCommand_InvokesProperAction()
{
$mock = $this->getMock(Request::class, [], [], '', false);
$mock->expects($this->any())->method('call')->will($this->returnCallback(function () {
return new PromiseFulfilled(['param' => 'value']);
}));
$command = $this->createCommand([], ['createRequest']);
$command->expects($this->atLeastOnce())->method('createRequest')->will($this->returnValue($mock));
$channel = $this->createChannel();
$runtime = $this->createRuntime();
$manager = $this->createManager();
$manager->expects($this->atLeastOnce())->method('getRuntimes')->will($this->returnValue(new PromiseFulfilled(['alias1', 'alias2'])));
$result = $this->callProtectedMethod($command, 'command', []);
$expect = $this->createCallableMock();
$expect->expects($this->once())->method('__invoke')->with(['parent' => 'parent', 'alias' => 'alias', 'name' => 'name', 'state' => 2, 'children' => [['param' => 'value'], ['param' => 'value']]]);
$result->then($expect);
}