public function DateRestrictionsStaticMinMaxTestCase::testDateWithinLimits in Date Restrictions 7
Date within fixed min-max date limits.
Test YYYY-04-12 is within [YYYY-04-01 YYYY-04-14]
File
- modules/
minmax/ tests/ date_restrictions_minmax.test, line 30 - Tests for date_restrictions_minmax.module.
Class
- DateRestrictionsStaticMinMaxTestCase
- Test "minmax" restrictions, based on static relative/fixed limits.
Code
public function testDateWithinLimits() {
$year = date('Y');
$restrictions = array(
'min' => array(
'type' => 'date',
'date' => array(
'year' => $year,
'month' => 4,
'day' => 1,
),
),
'max' => array(
'type' => 'date',
'date' => array(
'year' => $year,
'month' => 4,
'day' => 14,
),
),
);
parent::runTests($restrictions, NULL, array(
$this,
'_testDateWithinLimits',
));
}