Added the Porter Stemmer module to improve searches. This doesn't deal with some...
[yaffs-website] / web / modules / contrib / porterstemmer / tests / src / Unit / Porter2Test6.php
1 <?php
2
3 namespace Drupal\Tests\porterstemmer\Unit;
4
5 use Drupal\Tests\UnitTestCase;
6 use Drupal\porterstemmer\Porter2;
7
8 /**
9  * Tests the "PorterStemmer" implementation.
10  *
11  * @coversDefaultClass \Drupal\porterstemmer\Porter2
12  * @group porterstemmer
13  *
14  * @see \Drupal\porterstemmer\Porter2
15  */
16 class Porter2Test6 extends UnitTestCase {
17
18   use TestItemsTrait;
19
20   /**
21    * Test Porter2::stem() with a data provider method.
22    *
23    * Uses the data provider method to test with a wide range of words/stems.
24    *
25    * @dataProvider stemDataProvider
26    */
27   public function testStem($word, $stem) {
28     $this->assertEquals($stem, Porter2::stem($word));
29   }
30
31   /**
32    * Data provider for testStem().
33    *
34    * @return array
35    *   Nested arrays of values to check:
36    *   - $word
37    *   - $stem
38    */
39   public function stemDataProvider() {
40     return $this->retrieveStemWords(25000, 5000);
41   }
42
43 }