function BlockContentFieldFilterTest::testFilters

Tests body and info filters.

File

core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php, line 74

Class

BlockContentFieldFilterTest
Tests block_content field filters with translations.

Namespace

Drupal\Tests\block_content\Functional\Views

Code

public function testFilters() {
  // Test the info filter page, which filters for info contains 'Comida'.
  // Should show just the Spanish translation, once.
  $this->assertPageCounts('test-info-filter', [
    'es' => 1,
    'fr' => 0,
    'en' => 0,
  ], 'Comida info 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 info Paris filter page, which filters for info contains
  // 'Paris'. Should show each translation once.
  $this->assertPageCounts('test-info-paris', [
    'es' => 1,
    'fr' => 1,
    'en' => 1,
  ], 'Paris info 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.