diff --git a/factories/ContactFactory.php b/factories/ContactFactory.php index b7e75e5..1f98db8 100644 --- a/factories/ContactFactory.php +++ b/factories/ContactFactory.php @@ -282,4 +282,15 @@ public static function create($name, $phoneNumber, $emailAddress) return new Contact($contactDetails); } + + public static function delete(Contact $toDelete) + { + $client = GoogleHelper::getClient(); + + $req = new \Google_Http_Request($toDelete->editURL); + $req->setRequestHeaders(array('content-type' => 'application/atom+xml; charset=UTF-8; type=feed')); + $req->setRequestMethod('DELETE'); + + $client->getAuth()->authenticatedRequest($req); + } }