function ViewsHandlerFilterTest::testFilterInOperatorUi in Views (for Drupal 7) 7.3
Tests "is all of" of filter operation.
File
- tests/
views_handler_filter.test, line 56 - Definition of ViewsHandlerFilterTest.
Class
- ViewsHandlerFilterTest
- Tests filter handler.
Code
function testFilterInOperatorUi() {
$term = $this
->drupalCreateTerm(1);
$node1 = $this
->drupalCreateNode(array(
'type' => 'article',
'field_tags_tid' => $term->tid,
'created' => REQUEST_TIME,
));
$node2 = $this
->drupalCreateNode(array(
'type' => 'article',
'created' => REQUEST_TIME + 1,
));
$user2 = $this
->drupalCreateUser(array(
'access content',
));
// $this->drupalLogin($this->drupalCreateUser(array('administer users'));
$this
->drupalLogin($this
->drupalCreateUser(array(
'administer users',
'access administration pages',
'administer site configuration',
'administer nodes',
'bypass node access',
)));
$this
->drupalGet('node/1/edit');
$edit['field_tags' . '[' . LANGUAGE_NONE . ']'] = $term->name;
$this
->drupalPost('node/' . $node1->nid . '/edit', $edit, t('Save'));
$edit['field_tags' . '[' . LANGUAGE_NONE . ']'] = $term->name;
$this
->drupalPost('user/' . $user2->uid . '/edit', $edit, t('Save'));
$result[] = array(
'nid' => $node1->nid,
);
$view = $this
->get_sample_view();
$this
->executeView($view);
$this
->assertIdenticalResultset($view, $result);
}