diff options
author | Протопопов Валерий <v.protopopov@office.ngs.ru> | 2017-11-07 11:00:49 +0300 |
---|---|---|
committer | Протопопов Валерий <v.protopopov@office.ngs.ru> | 2017-11-07 11:12:47 +0300 |
commit | 5f5c5b124b2c8c7056aac01426d2c249d3f35aff (patch) | |
tree | bf288db2713490eb493a6d4834330eace1f0d2f5 /tests/StemmerTest.php | |
parent | fb502e2f603cc5a7d0268d281643e37ba8f80196 (diff) |
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
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 |