/**
  * @depends testGetTypeValuesAndLabels
  */
 public function testValidateDynamicDateIntegerValuePossibilities()
 {
     $form = new DateWorkflowActionAttributeForm('WorkflowModelTestItem', 'date');
     $form->type = DateWorkflowActionAttributeForm::TYPE_DYNAMIC_FROM_TRIGGERED_DATE;
     $form->shouldSetValue = true;
     $validated = $form->validate();
     $this->assertFalse($validated);
     $compareErrors = array('durationInterval' => array('Interval cannot be blank.'));
     $this->assertEquals($compareErrors, $form->getErrors());
     $form->value = '';
     $validated = $form->validate();
     $this->assertFalse($validated);
     $compareErrors = array('durationInterval' => array('Interval cannot be blank.'));
     $this->assertEquals($compareErrors, $form->getErrors());
     $form->durationInterval = 0;
     $validated = $form->validate();
     $this->assertTrue($validated);
     $form->durationInterval = '0';
     $validated = $form->validate();
     $this->assertTrue($validated);
 }
 /**
  * @depends testCurrencyValueWorkflowAttributeFormSetGetAndValidate
  */
 public function testDateWorkflowAttributeFormSetGetAndValidate()
 {
     $form = new DateWorkflowActionAttributeForm('WorkflowModelTestItem', 'date');
     $form->type = WorkflowActionAttributeForm::TYPE_STATIC;
     $form->shouldSetValue = true;
     $form->value = '2012-02-24';
     $validated = $form->validate();
     $this->assertTrue($validated);
     //Test invalid date
     $form->value = 'invalid date';
     $validated = $form->validate();
     $this->assertFalse($validated);
     //test valid date, but not correct format for dynamic type
     $form->type = DateWorkflowActionAttributeForm::TYPE_DYNAMIC_FROM_TRIGGERED_DATE;
     $form->value = '2012-02-24';
     $validated = $form->validate();
     $this->assertFalse($validated);
     //Test valid date and valid format for dynamic type
     $form->durationInterval = 8600;
     $form->durationSign = TimeDurationUtil::DURATION_SIGN_NEGATIVE;
     $validated = $form->validate();
     $this->assertTrue($validated);
     $form->durationInterval = 3000;
     $form->durationSign = TimeDurationUtil::DURATION_SIGN_POSITIVE;
     $validated = $form->validate();
     $this->assertTrue($validated);
 }