getKeysValue() public method

Get all key-value pair that the key is not directory.
public getKeysValue ( $root = '/', boolean $recursive = true, string $key = null ) : array
$recursive boolean
$key string
return array
Example #1
0
 /**
  * @covers LinkORB\Component\Etcd\Client::getKeysValue
  */
 public function testGetKeysValue()
 {
     $this->client->set('/a/aa', 'a_a');
     $this->client->set('/a/ab', 'a_b');
     $this->client->set('/a/b/ab', 'aa_b');
     $values = $this->client->getKeysValue('/', false);
     $this->assertFalse(isset($values[$this->dirname . '/a/aa']));
     $values = $this->client->getKeysValue();
     $this->assertTrue(isset($values[$this->dirname . '/a/aa']));
     $this->assertEquals('a_a', $values[$this->dirname . '/a/aa']);
     $this->assertTrue(in_array('aa_b', $values));
 }