public function __invoke(CommandTransaction $trans) { $command = $trans->command; $operation = $this->api->getOperation($command->getName()); $args = $command->toArray(); $request = $trans->client->createRequest($operation['http']['method'], $this->buildEndpoint($operation, $args), ['config' => ['command' => $command]]); return $this->serialize($request, $operation, $args); }
/** * @expectedException \InvalidArgumentException */ public function testEnsuresOperationExists() { $s = new Service(function () { }, '', ''); $s->getOperation('foo'); }