public function testSetDataThrowsExceptionIfAlreadySubmitted() { $this->
expectException(AlreadySubmittedException::
class);
$this->form->
submit([]);
$this->form->
setData(null
);
} public function testSetDataClonesObjectIfNotByReference() { $data =
new \
stdClass();
$form =
$this->
getBuilder('name', \stdClass::
class)->
setByReference(false
)->
getForm();
$form->
setData($data);
$this->
assertNotSame($data,
$form->
getData());
$this->
assertEquals($data,
$form->
getData());
} public function testSetDataDoesNotCloneObjectIfByReference() { $data =
new \
stdClass();
$form =
$this->
getBuilder('name', \stdClass::
class)->
setByReference(true
)->
getForm();
$form->
setData($data);