Révision 6f57d8c7
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/views/tests/handlers/views_handler_filter_date.test | ||
---|---|---|
50 | 50 |
$this->assertIdenticalResultset($view, $expected_result, $this->map); |
51 | 51 |
$view->destroy(); |
52 | 52 |
|
53 |
// Test "first day of" type of relative dates for simple operator. |
|
54 |
$view->set_display('default'); |
|
55 |
$view->init_handlers(); |
|
56 |
$view->filter['created']->operator = '<'; |
|
57 |
$view->filter['created']->value['type'] = 'offset'; |
|
58 |
$view->filter['created']->value['value'] = 'last day of January 1970'; |
|
59 |
$view->execute_display('default'); |
|
60 |
$expected_result = array( |
|
61 |
array('nid' => $this->nodes[0]->nid), |
|
62 |
array('nid' => $this->nodes[1]->nid), |
|
63 |
array('nid' => $this->nodes[2]->nid), |
|
64 |
); |
|
65 |
$this->assertIdenticalResultset($view, $expected_result, $this->map); |
|
66 |
$view->destroy(); |
|
67 |
|
|
53 | 68 |
// Test offset for between operator. |
54 | 69 |
$view->set_display('default'); |
55 | 70 |
$view->init_handlers(); |
... | ... | |
63 | 78 |
); |
64 | 79 |
$this->assertIdenticalResultset($view, $expected_result, $this->map); |
65 | 80 |
$view->destroy(); |
81 |
|
|
82 |
// Test "first day of" type of relative dates for between operator. |
|
83 |
$view->set_display('default'); |
|
84 |
$view->init_handlers(); |
|
85 |
$view->filter['created']->operator = 'between'; |
|
86 |
$view->filter['created']->value['type'] = 'offset'; |
|
87 |
$view->filter['created']->value['max'] = 'last day of January 1970'; |
|
88 |
$view->filter['created']->value['min'] = 'first day of January 1970'; |
|
89 |
$view->execute_display('default'); |
|
90 |
$expected_result = array( |
|
91 |
array('nid' => $this->nodes[0]->nid), |
|
92 |
array('nid' => $this->nodes[1]->nid), |
|
93 |
array('nid' => $this->nodes[2]->nid), |
|
94 |
); |
|
95 |
$this->assertIdenticalResultset($view, $expected_result, $this->map); |
|
96 |
$view->destroy(); |
|
66 | 97 |
} |
67 | 98 |
|
68 | 99 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules