Chris@0: drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); Chris@4: Chris@0: node_access_rebuild(); Chris@0: Chris@0: // Create a test user and log in. Chris@0: $this->testUser = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'access user profiles']); Chris@0: $this->drupalLogin($this->testUser); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Tests that search returns results with diacritics in the search phrase. Chris@0: */ Chris@0: public function testPhraseSearchPunctuation() { Chris@0: $body_text = 'The Enricþment Center is cómmīŦŧęđ to the well BɆĬŇĜ of æll påŔťıçȉpǎǹţș. '; Chris@0: $body_text .= 'Also meklēt (see #731298)'; Chris@0: $this->drupalCreateNode(['body' => [['value' => $body_text]]]); Chris@0: Chris@0: // Update the search index. Chris@0: $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); Chris@0: search_update_totals(); Chris@0: Chris@0: // Refresh variables after the treatment. Chris@0: $this->refreshVariables(); Chris@0: Chris@0: $edit = ['keys' => 'meklet']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertRaw('meklēt'); Chris@0: Chris@0: $edit = ['keys' => 'meklēt']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertRaw('meklēt'); Chris@0: Chris@0: $edit = ['keys' => 'cómmīŦŧęđ BɆĬŇĜ påŔťıçȉpǎǹţș']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertRaw('cómmīŦŧęđ'); Chris@0: $this->assertRaw('BɆĬŇĜ'); Chris@0: $this->assertRaw('påŔťıçȉpǎǹţș'); Chris@0: Chris@0: $edit = ['keys' => 'committed being participants']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertRaw('cómmīŦŧęđ'); Chris@0: $this->assertRaw('BɆĬŇĜ'); Chris@0: $this->assertRaw('påŔťıçȉpǎǹţș'); Chris@0: Chris@0: $edit = ['keys' => 'Enricþment']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertRaw('Enricþment'); Chris@0: Chris@0: $edit = ['keys' => 'Enritchment']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertNoRaw('Enricþment'); Chris@0: Chris@0: $edit = ['keys' => 'æll']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertRaw('æll'); Chris@0: Chris@0: $edit = ['keys' => 'all']; Chris@0: $this->drupalPostForm('search/node', $edit, t('Search')); Chris@0: $this->assertNoRaw('æll'); Chris@0: } Chris@0: Chris@0: }