public function testInvalidFormsContainMessagesForTheInvalidElements()
 {
     $record = new ValidationStub();
     $form = new ZendX_Form_Doctrine($record);
     $message = 'This field should not be empty';
     $form->setValidationMessage('stringValidation', 'notnull', $message);
     $this->assertFalse($form->isValid(array()));
     $this->assertContains($message, $form->getElement('stringValidation')->getErrorMessages());
 }
 public function testFormForModelWithoutAnySavedRelationsShouldYeildANonSelectedMultiselect()
 {
     $this->setUpCarsAndDrivers();
     $form = new ZendX_Form_Doctrine($this->drivers['emo']);
     $carsToDriveElement = $form->getElement('CarsToDrive');
     /* @var $carsToDriveElement Zend_Form_Element_Multiselect */
     $this->assertNull($carsToDriveElement->getValue());
 }
 public function assertColumnMappingToElement($name, $formFieldClass)
 {
     $this->assertType($formFieldClass, $this->form->getElement($name));
 }