1 views_handler_filter_multiple.test ViewsHandlerFilterMultipleTest::testMultipleFilters()

Tests combining an exposed filter with a non-exposed one.

File

core/modules/views/tests/handlers/views_handler_filter_multiple.test, line 48
Definition of ViewsHandlerFilterTest.

Class

ViewsHandlerFilterMultipleTest
Tests filter handler.

Code

function testMultipleFilters() {
  $term = $this->viewsCreateTerm('tags');

  $node1 = $this->backdropCreateNode(array('type' => 'post', 'created' => REQUEST_TIME));
  $node2 = $this->backdropCreateNode(array('type' => 'post', 'created' => REQUEST_TIME + 1));
  $user1 = $this->backdropCreateUser(array('access content'));
  $user2 = $this->backdropCreateUser(array('administer users', 'access administration pages', 'administer site configuration', 'administer nodes', 'bypass node access'));
  $this->backdropLogin($user2);

  $this->backdropGet('node/' . $node1->nid . '/edit');
  $edit['field_tags[' . LANGUAGE_NONE . ']'] = $term->name;
  $this->backdropPost('node/' . $node1->nid . '/edit', $edit, t('Save'));

  $edit['field_tags[' . LANGUAGE_NONE . ']'] = $term->name;
  $this->backdropPost('user/' . $user1->uid . '/edit', $edit, t('Save'));

  $result[] = array('nid' => $node1->nid);
  $view = views_get_view('multiple_filters_test');
  $this->executeView($view);
  $this->assertIdenticalResultset($view, $result, array('nid' => 'nid'));
}