public function DateRestrictionsStaticMinMaxTestCase::_testDateLowerThanMin in Date Restrictions 7
File
- modules/
minmax/ tests/ date_restrictions_minmax.test, line 82 - Tests for date_restrictions_minmax.module.
Class
- DateRestrictionsStaticMinMaxTestCase
- Test "minmax" restrictions, based on static relative/fixed limits.
Code
public function _testDateLowerThanMin($context) {
$year = date('Y');
$start = array(
'year' => $year,
'month' => 4,
'day' => 12,
);
$this
->postNode($context['field_name'], $context['field_type'], $context['widget_type'], $start);
$date = $this
->newDateObject($context['restrictions']['min']['date'], NULL, FALSE);
$message = t('Dates before @date are not allowed', array(
'@date' => $date
->format($this->date_input_format),
));
$this
->assertText($message, 'Dates before min date are not allowed (static).');
}