try { $result = $adGroupAdValidationService->mutate($operations); printf("The text ad is valid.\n"); } catch (SoapFault $e) { $errors = ErrorUtils::GetApiErrors($e); if (sizeof($errors) > 0) { printf("The text ad is invalid for the following reasons:\n"); foreach ($errors as $error) { printf(" %s @ %s\n", $error->errorString, $error->fieldPath); } } else { // Not an API error, so throw it up a level. throw $e; } } } // Don't run the example if the file is being included. if (__FILE__ != realpath($_SERVER['PHP_SELF'])) { return; } try { // Get AdWordsUser from credentials in "../auth.ini" // relative to the AdWordsUser.php file's directory. $user = new AdWordsUser(); // Log every SOAP XML request and response. $user->LogAll(); // Run the example. ValidateTextAdExample($user, $adGroupId); } catch (Exception $e) { printf("An error has occurred: %s\n", $e->getMessage()); }
public function testValidateTextAdExample() { ValidateTextAdExample($this->user, $this->adGroupId); }