/** * @covers LinkORB\Component\Etcd\Client::updatedir */ public function testUpdatedir() { $dirname = '/test_updatedir'; $this->client->mkdir($dirname); $this->client->updateDir($dirname, 10); $dir = $this->client->listDir($dirname); $this->assertLessThanOrEqual(10, $dir['node']['ttl']); }
public function execute(InputInterface $input, OutputInterface $output) { $server = $input->getArgument('server'); $key = $input->getArgument('key'); $ttl = $input->getOption('ttl'); $output->writeln("<info>Update ttl the dir with key `{$key}`</info>"); $client = new EtcdClient($server); $data = $client->updateDir($key, $ttl); $json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); echo $json; }