public function testInvalidSubmissionFieldsMissing($field, $parent = 'attributes', $message = null)
{
$data = json_decode(json_encode($this->validSubmission));
$data->attributes->admin_username = 'phptest' . time();
$data->attributes->admin_password = 'password1234';
$data->attributes->admin_domain = 'mail.phptest' . time() . '.com';
$data->attributes->domain = 'new-' . $data->attributes->admin_domain;
$data->attributes->list = 'phptest' . time();
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 SetDomainAllowList('array', $data);
}