You are here

public function Porter2Pecl5::testStem in Porter-Stemmer 8

Test PECL stem_english() with a data provider method.

Uses the data provider method to test with a wide range of words/stems.

@dataProvider stemDataProvider

File

tests/src/Unit/Porter2Pecl5.php, line 21

Class

Porter2Pecl5
Tests the "PorterStemmer" implementation with PECL stem_english().

Namespace

Drupal\Tests\porterstemmer\Unit

Code

public function testStem($word, $stem) {
  if ($this->hasPeclStem) {
    $this
      ->assertEquals($stem, stem_english($word));
  }
  else {
    $this
      ->markTestSkipped('No PECL stem library found, Aborting test.');
  }
}