public function testInvalidSubmissionFieldsMissing($field, $parent = 'attributes', $message = null)
{
$data = json_decode(json_encode($this->validSubmission));
$data->attributes->domain = 'phptest' . time() . '.com';
$data->attributes->service_type = 'test-service';
if (is_null($message)) {
$this->setExpectedExceptionRegExp('opensrs\\Exception', "/{$field}.*not defined/");
} else {
$this->setExpectedExceptionRegExp('opensrs\\Exception', "/{$message}/");
}
// clear field being tested
if (is_null($parent)) {
unset($data->{$field});
} else {
unset($data->{$parent}->{$field});
}
$ns = new GetControlPanelUrl('array', $data);
}