Commit 010a9794 authored by borisson_'s avatar borisson_ Committed by borisson_
Browse files

Issue #2838247 by borisson_: Facet labels doesn't show special term characters

parent 0c5e9df5
......@@ -66,4 +66,47 @@ class LanguageIntegrationTest extends FacetsTestBase {
$this->assertText('article');
}
/**
* Tests that special characters work such as äüö work.
*
* @see https://www.drupal.org/node/2838247
* @see https://www.drupal.org/node/2838697
*/
public function testSpecialCharacters() {
$id = 'water_bear';
$name = 'Water bear';
$this->createFacet($name, $id, 'keywords');
$this->drupalGet('search-api-test-fulltext');
$this->assertFacetBlocksAppear();
$this->assertFacetLabel('orange');
$entity_test_storage = \Drupal::entityTypeManager()
->getStorage('entity_test_mulrev_changed');
$entity_test_storage->create([
'name' => 'special-chars 1',
'body' => 'test test test',
'type' => 'article',
'keywords' => ['ƒäüö', 'test_key-word', 'special^%s', 'Key Word'],
'category' => 'article_category',
])->save();
$entity_test_storage->create([
'name' => 'special-chars 2',
'body' => 'test test test',
'type' => 'article',
'keywords' => ['ƒäüö', 'special^%s', 'aáå'],
'category' => 'article_category',
])->save();
$this->assertEquals(2, $this->indexItems($this->indexId), '2 items were indexed.');
$this->drupalGet('search-api-test-fulltext');
$this->assertFacetBlocksAppear();
$this->assertFacetLabel('orange');
$this->assertFacetLabel('ƒäüö');
$this->assertFacetLabel('aáå');
$this->assertFacetLabel('special^%s');
$this->assertFacetLabel('test_key-word');
$this->assertFacetLabel('Key Word');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment