public function execute(InputInterface $input, OutputInterface $output) { $server = $input->getArgument('server'); $key = $input->getArgument('key'); $value = $input->getArgument('value'); $output->writeln("<info>Create `{$key}` with `{$value}`</info>"); $client = new EtcdClient($server); $data = $client->mk($key, $value); $json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); echo $json; }
/** * @covers LinkORB\Component\Etcd\Client::mk * @expectedException \LinkORB\Component\Etcd\Exception\KeyExistsException */ public function testMk() { $this->client->mk('testmk', 'mkvalue'); $this->assertEquals('mkvalue', $this->client->get('testmk')); $this->client->mk('testmk', 'mkvalue'); }