public function DateRangeFieldValidationRuleTest::testValidDateRangeRule in Field Validation 8
Tests valid date inputs.
@dataProvider dateValidProvider
Parameters
string $cycle: Cycle setting.
string $date_string: Input.
string $min_date: Minimum date.
string $max_date: Maximal date.
Throws
\Drupal\Core\Entity\EntityStorageException
File
- tests/
src/ Kernel/ Plugin/ FieldValidationRule/ DateRangeFieldValidationRuleTest.php, line 100
Class
- DateRangeFieldValidationRuleTest
- Tests DateRangeFieldValidationRule.
Namespace
Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRuleCode
public function testValidDateRangeRule(string $cycle, string $date_string, string $min_date, string $max_date) {
$this->ruleSet = $this
->updateSettings([
'min' => $min_date,
'max' => $max_date,
'cycle' => $cycle,
], self::RULE_ID, self::RULE_TITLE, $this->ruleSet, self::FIELD_NAME);
$this
->assertConstraintPass($this->entity, self::FIELD_NAME, $date_string);
}