/** * @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); }