diff options
author | Alexander Kiryukhin <alexander@kiryukhin.su> | 2017-11-07 15:35:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-07 15:35:34 +0300 |
commit | f18b94cf00426e57261deabe6cfd977d434bd228 (patch) | |
tree | bf288db2713490eb493a6d4834330eace1f0d2f5 /tests/StemmerTest.php | |
parent | fb502e2f603cc5a7d0268d281643e37ba8f80196 (diff) | |
parent | 5f5c5b124b2c8c7056aac01426d2c249d3f35aff (diff) |
Merge pull request #7 from acelot/master
All methods are now static
Diffstat (limited to 'tests/StemmerTest.php')
-rw-r--r-- | tests/StemmerTest.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/StemmerTest.php b/tests/StemmerTest.php index 6cbcbfc..7491a7a 100644 --- a/tests/StemmerTest.php +++ b/tests/StemmerTest.php @@ -12,12 +12,19 @@ namespace NXP; class StemmerTest extends \PHPUnit_Framework_TestCase { - public function testStemming() + public function testStemmingDataProvider() { - $stemmer = new Stemmer(); - $testWords = require("dict.php"); - foreach ($testWords as $word => $base) { - $this->assertEquals($base, $stemmer->getWordBase($word)); - } + return require("dict.php"); + } + + /** + * @dataProvider testStemmingDataProvider + * + * @param string $word + * @param string $expected + */ + public function testStemming($word, $expected) + { + $this->assertEquals($expected, Stemmer::getWordBase($word)); } }
\ No newline at end of file |