public function testInvalidSubmissionFieldsMissing($field, $parent = 'attributes', $message = null)
{
$data = json_decode(json_encode($this->validSubmission));
$data->attributes->change_type = 'dns_zone';
$data->attributes->change_items = 'ns1.phptest.com,ns2.phptest.com';
$data->attributes->op_type = 'test_op_type';
$data->attributes->contact_email = '[email protected]';
$data->attributes->apply_to_locked_domains = 'N';
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 BulkSubmit('array', $data);
}