3 namespace Tests\Wallabag\CoreBundle\Tools
;
5 use Symfony\Component\Finder\Finder
;
6 use Wallabag\CoreBundle\Tools\Utils
;
8 class UtilsTest
extends \PHPUnit_Framework_TestCase
11 * @dataProvider examples
13 public function testCorrectWordsCountForDifferentLanguages($text, $expectedCount)
15 static::assertEquals((float) $expectedCount, Utils
::getReadingTime($text));
18 public function examples()
21 $finder = (new Finder())->in(__DIR__
.'/samples');
22 foreach ($finder->getIterator() as $file) {
23 $examples[] = [$file->getContents(), 1];