Esempio n. 1
0
 public function testAddKey()
 {
     $this->mockSimpleRequest($this->httpClient, 'post', json_encode($this->loadJsonFixture('fixture_key.json')));
     $repository = new Repository($this->httpClient);
     $repository->populate($this->loadJsonFixture('fixture_repository.json'));
     $key = new Key();
     $key->setTitle('hello word');
     $key->setKey('123');
     $this->assertNull($key->getId());
     $repository->addKey($key);
     $this->assertEquals(1, $key->getId());
 }