]> git.immae.eu Git - github/wallabag/wallabag.git/blob - tests/Wallabag/CoreBundle/Tools/UtilsTest.php
Add a real configuration for CS-Fixer
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Tools / UtilsTest.php
1 <?php
2
3 namespace Tests\Wallabag\CoreBundle\Tools;
4
5 use Symfony\Component\Finder\Finder;
6 use Wallabag\CoreBundle\Tools\Utils;
7
8 class UtilsTest extends \PHPUnit_Framework_TestCase
9 {
10 /**
11 * @dataProvider examples
12 */
13 public function testCorrectWordsCountForDifferentLanguages($text, $expectedCount)
14 {
15 static::assertEquals((float) $expectedCount, Utils::getReadingTime($text));
16 }
17
18 public function examples()
19 {
20 $examples = [];
21 $finder = (new Finder())->in(__DIR__ . '/samples');
22 foreach ($finder->getIterator() as $file) {
23 $examples[] = [$file->getContents(), 1];
24 }
25
26 return $examples;
27 }
28 }