Exemplo n.º 1
0
 public function testInstance()
 {
     $delete = new Delete($this->transport);
     $delete->setId(10);
     $this->assertEquals(10, $delete->getId());
     $this->assertEquals([], $delete->getParamWhiteList());
     $this->assertEquals('DELETE', $delete->getMethod());
     $this->assertEquals('subscriptions/10/', $delete->getURI());
 }
 /**
  * @param int $id
  * @return bool
  */
 public function delete($id)
 {
     $endpoint = new Delete($this->getTransport());
     $endpoint->setId($id);
     try {
         $result = $endpoint->performRequest();
     } catch (ResourceNotFoundException $e) {
         return false;
     }
     return $result['status'] == 204;
 }