function CommentFieldFilterTest::testFilters

Same name in other branches
  1. 9 core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php \Drupal\Tests\comment\Functional\Views\CommentFieldFilterTest::testFilters()
  2. 10 core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php \Drupal\Tests\comment\Functional\Views\CommentFieldFilterTest::testFilters()
  3. 11.x core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php \Drupal\Tests\comment\Functional\Views\CommentFieldFilterTest::testFilters()

Tests body and title filters.

File

core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php, line 83

Class

CommentFieldFilterTest
Tests comment field filters with translations.

Namespace

Drupal\Tests\comment\Functional\Views

Code

public function testFilters() {
    // Test the title filter page, which filters for title contains 'Comida'.
    // Should show just the Spanish translation, once.
    $this->assertPageCounts('test-title-filter', [
        'es' => 1,
        'fr' => 0,
        'en' => 0,
    ], 'Comida title filter');
    // Test the body filter page, which filters for body contains 'Comida'.
    // Should show just the Spanish translation, once.
    $this->assertPageCounts('test-body-filter', [
        'es' => 1,
        'fr' => 0,
        'en' => 0,
    ], 'Comida body filter');
    // Test the title Paris filter page, which filters for title contains
    // 'Paris'. Should show each translation once.
    $this->assertPageCounts('test-title-paris', [
        'es' => 1,
        'fr' => 1,
        'en' => 1,
    ], 'Paris title filter');
    // Test the body Paris filter page, which filters for body contains
    // 'Paris'. Should show each translation once.
    $this->assertPageCounts('test-body-paris', [
        'es' => 1,
        'fr' => 1,
        'en' => 1,
    ], 'Paris body filter');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.