public function TaxonomyFieldFilterTest::testFilters in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php \Drupal\taxonomy\Tests\Views\TaxonomyFieldFilterTest::testFilters()
Tests description and term name filters.
File
- core/
modules/ taxonomy/ src/ Tests/ Views/ TaxonomyFieldFilterTest.php, line 102 - Contains \Drupal\taxonomy\Tests\Views\TaxonomyFieldFilterTest.
Class
- TaxonomyFieldFilterTest
- Tests taxonomy field filters with translations.
Namespace
Drupal\taxonomy\Tests\ViewsCode
public function testFilters() {
// Test the name filter page, which filters for name contains 'Comida'.
// Should show just the Spanish translation, once.
$this
->assertPageCounts('test-name-filter', array(
'es' => 1,
'fr' => 0,
'en' => 0,
), 'Comida name filter');
// Test the description filter page, which filters for description contains
// 'Comida'. Should show just the Spanish translation, once.
$this
->assertPageCounts('test-desc-filter', array(
'es' => 1,
'fr' => 0,
'en' => 0,
), 'Comida description filter');
// Test the field filter page, which filters for field_foo contains
// 'Comida'. Should show just the Spanish translation, once.
$this
->assertPageCounts('test-field-filter', array(
'es' => 1,
'fr' => 0,
'en' => 0,
), 'Comida field filter');
// Test the name Paris filter page, which filters for name contains
// 'Paris'. Should show each translation once.
$this
->assertPageCounts('test-name-paris', array(
'es' => 1,
'fr' => 1,
'en' => 1,
), 'Paris name filter');
// Test the description Paris page, which filters for description contains
// 'Paris'. Should show each translation, once.
$this
->assertPageCounts('test-desc-paris', array(
'es' => 1,
'fr' => 1,
'en' => 1,
), 'Paris description filter');
// Test the field Paris filter page, which filters for field_foo contains
// 'Paris'. Should show each translation once.
$this
->assertPageCounts('test-field-paris', array(
'es' => 1,
'fr' => 1,
'en' => 1,
), 'Paris field filter');
}