public function testCanNotRemoveNameOrId() { $obj = new HTML_QuickForm2_ContainerImpl('somename', array(), array('id' => 'someid')); try { $obj->removeAttribute('name'); } catch (HTML_QuickForm2_InvalidArgumentException $e) { $this->assertRegExp('/Required attribute(.*)can not be removed/', $e->getMessage()); try { $obj->removeAttribute('id'); } catch (HTML_QuickForm2_InvalidArgumentException $e) { $this->assertRegExp('/Required attribute(.*)can not be removed/', $e->getMessage()); return; } } $this->fail('Expected HTML_QuickForm2_InvalidArgumentException was not thrown'); }