From 5f5c5b124b2c8c7056aac01426d2c249d3f35aff Mon Sep 17 00:00:00 2001 From: Протопопов Валерий Date: Tue, 7 Nov 2017 15:00:49 +0700 Subject: All methods are now static - Restore original mb_internal_encoding after method call - Add PHPUnit 5.0 to dev-deps - dict.php wrapped into PHPUnit data provider - Increased memory limit for tests --- tests/StemmerTest.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'tests/StemmerTest.php') 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 -- cgit v1.2.3