/** * @covers Intacct\FieldTypes\Record::setFields * @expectedException InvalidArgumentException * @expectedExceptionMessage "456INVALID" is not a valid name for an XML element */ public function testConstructFailureInvalidFieldName() { $xml = new XMLWriter(); $xml->openMemory(); $xml->setIndent(true); $xml->setIndentString(' '); $xml->startDocument(); $record = new Record(); $record->setObjectName('CLASS'); $record->setFields(['CLASSID' => 'UT01', 'NAME' => 'Unit Test 01', '456INVALID' => 'unit test']); $record->writeXml($xml); }