1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Definition of viewsHandlerFilterCommentUserUidTest.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Tests the filter_comment_user_uid handler.
|
10 |
|
|
*
|
11 |
|
|
* The actual stuff is done in the parent class.
|
12 |
|
|
*/
|
13 |
|
|
class viewsHandlerFilterCommentUserUidTest extends viewsHandlerArgumentCommentUserUidTest {
|
14 |
|
|
public static function getInfo() {
|
15 |
|
|
return array(
|
16 |
|
|
'name' => 'Tests handler filter_comment_user_uid',
|
17 |
|
|
'description' => 'Tests the user posted or commented filter handler',
|
18 |
|
|
'group' => 'Views Modules',
|
19 |
|
|
);
|
20 |
|
|
}
|
21 |
|
|
|
22 |
|
|
/**
|
23 |
|
|
* Override the view from the argument test case to remove the argument and
|
24 |
|
|
* add filter with the uid as the value.
|
25 |
|
|
*/
|
26 |
|
|
function view_comment_user_uid() {
|
27 |
|
|
$view = parent::view_comment_user_uid();
|
28 |
|
|
// Remove the argument.
|
29 |
|
|
$view->set_item('default', 'argument', 'uid_touch', NULL);
|
30 |
|
|
|
31 |
|
|
$options = array(
|
32 |
|
|
'id' => 'uid_touch',
|
33 |
|
|
'table' => 'node',
|
34 |
|
|
'field' => 'uid_touch',
|
35 |
|
|
'value' => array($this->loggedInUser->uid),
|
36 |
|
|
);
|
37 |
|
|
$view->add_item('default', 'filter', 'node', 'uid_touch', $options);
|
38 |
|
|
|
39 |
|
|
return $view;
|
40 |
|
|
}
|
41 |
|
|
} |