FilterUserUIDTest.php 1.37 KB
Newer Older
merlinofchaos's avatar
merlinofchaos committed
1 2 3 4
<?php

/**
 * @file
5
 * Definition of Drupal\views\Tests\Comment\FilterUserUIDTest.
merlinofchaos's avatar
merlinofchaos committed
6 7
 */

8 9
namespace Drupal\views\Tests\Comment;

merlinofchaos's avatar
merlinofchaos committed
10 11 12 13 14
/**
 * Tests the filter_comment_user_uid handler.
 *
 * The actual stuff is done in the parent class.
 */
15 16
class FilterUserUIDTest extends CommentTestBase {

17 18 19 20 21 22 23
  /**
   * Views used by this test.
   *
   * @var array
   */
  public static $testViews = array('test_comment_user_uid');

merlinofchaos's avatar
merlinofchaos committed
24 25
  public static function getInfo() {
    return array(
26 27
      'name' => 'Comment: User UID Filter',
      'description' => 'Tests the user posted or commented filter handler.',
merlinofchaos's avatar
merlinofchaos committed
28 29 30 31
      'group' => 'Views Modules',
    );
  }

32
  function testCommentUserUIDTest() {
33 34 35
    $view = views_get_view('test_comment_user_uid');
    $view->setDisplay();
    $view->setItem('default', 'argument', 'uid_touch', NULL);
merlinofchaos's avatar
merlinofchaos committed
36 37 38 39 40 41 42

    $options = array(
      'id' => 'uid_touch',
      'table' => 'node',
      'field' => 'uid_touch',
      'value' => array($this->loggedInUser->uid),
    );
43 44
    $view->addItem('default', 'filter', 'node', 'uid_touch', $options);
    $this->executeView($view, array($this->account->uid));
45 46 47 48 49 50 51 52 53
    $result_set = array(
      array(
        'nid' => $this->node_user_posted->nid,
      ),
      array(
        'nid' => $this->node_user_commented->nid,
      ),
    );
    $this->column_map = array('nid' => 'nid');
54
    $this->assertIdenticalResultset($view, $result_set, $this->column_map);
55 56
  }

merlinofchaos's avatar
merlinofchaos committed
57
}