Ejemplo n.º 1
0
 public function addKey(Key $key)
 {
     $url = TemplateUrlGenerator::generate($this->getAttribute('keys_url'), ['key_id' => null]);
     $response = $this->post($url, ['title' => $key->getTitle(), 'key' => $key->getKey()]);
     $key->populate($response);
     // repopulate for getting the id
 }
Ejemplo n.º 2
0
 public function testSetter()
 {
     $key = new Key();
     $key->populate($this->loadJsonFixture('fixture_key.json'));
     $key->setKey('hello world');
     $key->setTitle('my first key');
     $this->assertEquals('hello world', $key->getKey());
     $this->assertEquals('my first key', $key->getTitle());
 }