aboutsummaryrefslogtreecommitdiff
path: root/tests/StemmerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/StemmerTest.php')
-rw-r--r--tests/StemmerTest.php19
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