/** * Delete this object from the graph * * @param array $params * @return void * @throws \Exception */ public function delete(array $params = array()) { if (!$this->data[AdImageFields::HASH]) { throw new \Exception("AdImage hash is required to delete"); } $params = array_merge($params, array('hash' => $this->data[AdImageFields::HASH])); parent::delete($params); }
/** * @param AbstractCrudObject $subject */ public function assertCannotDelete(AbstractCrudObject $subject) { $has_throw_exception = false; try { $subject->delete(); } catch (\Exception $e) { $has_throw_exception = true; } $this->assertTrue($has_throw_exception); }