1 |
599a39cd
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Test the handling of the two included field widgets.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Test the handling of the two included field widgets.
|
10 |
|
|
*/
|
11 |
|
|
class DateFieldTestCase extends DateFieldTestBase {
|
12 |
|
|
|
13 |
|
|
/**
|
14 |
|
|
* Test relative default values.
|
15 |
|
|
*/
|
16 |
|
|
public function testRelativeDefault() {
|
17 |
|
|
$edit = array();
|
18 |
|
|
$edit['name'] = 'Date Relative Default Test';
|
19 |
|
|
$edit['type'] = 'date_relative_default_test';
|
20 |
|
|
$this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
|
21 |
|
|
$this->assertText('The content type Date Relative Default Test has been added.', 'Content type added.');
|
22 |
|
|
|
23 |
|
|
$options = array(
|
24 |
|
|
'bundle' => 'date_relative_default_test',
|
25 |
|
|
'default_value' => 'strtotime',
|
26 |
|
|
'default_value_code' => '+1',
|
27 |
|
|
);
|
28 |
|
|
$this->createDateField($options);
|
29 |
|
|
|
30 |
|
|
$edit = array();
|
31 |
|
|
$edit['title'] = $this->randomName(8);
|
32 |
|
|
$this->drupalPost('node/add/date-relative-default-test', $edit, t('Save'));
|
33 |
|
|
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
/**
|
37 |
|
|
* @todo.
|
38 |
|
|
*/
|
39 |
|
|
public static function getInfo() {
|
40 |
|
|
return array(
|
41 |
|
|
'name' => 'Date Field',
|
42 |
|
|
'description' => 'Test date field settings and Start/End date interaction.',
|
43 |
|
|
'group' => 'Date',
|
44 |
|
|
);
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
/**
|
48 |
|
|
* Check all of the included field types for basic functionality.
|
49 |
|
|
*/
|
50 |
|
|
public function testField() {
|
51 |
|
|
// Create a date fields with simple values.
|
52 |
|
|
foreach (array('date', 'datestamp', 'datetime') as $field_type) {
|
53 |
|
|
foreach (array('date_select', 'date_text') as $widget_type) {
|
54 |
|
|
$this->checkDateField($field_type, $widget_type, TRUE);
|
55 |
|
|
}
|
56 |
|
|
}
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
} |