diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 19:26:54 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 19:26:54 +0200 |
commit | 4f5b44bd3bd490309eb2ba7b44df4769816ba729 (patch) | |
tree | 6cefe170dfe0a5a361cb1e2d1fc4d580a3316d02 /vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php | |
parent | 2b840e0cfb63a453bea67a98541f3df9c273c5f5 (diff) | |
download | wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.tar.gz wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.tar.zst wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.zip |
twig implementation
Diffstat (limited to 'vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php')
-rw-r--r-- | vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php new file mode 100644 index 00000000..075c98b7 --- /dev/null +++ b/vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php | |||
@@ -0,0 +1,48 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\Interval; | ||
15 | |||
16 | class IntervalTest extends \PHPUnit_Framework_TestCase | ||
17 | { | ||
18 | /** | ||
19 | * @dataProvider getTests | ||
20 | */ | ||
21 | public function testTest($expected, $number, $interval) | ||
22 | { | ||
23 | $this->assertEquals($expected, Interval::test($number, $interval)); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * @expectedException \InvalidArgumentException | ||
28 | */ | ||
29 | public function testTestException() | ||
30 | { | ||
31 | Interval::test(1, 'foobar'); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | return array( | ||
37 | array(true, 3, '{1,2, 3 ,4}'), | ||
38 | array(false, 10, '{1,2, 3 ,4}'), | ||
39 | array(false, 3, '[1,2]'), | ||
40 | array(true, 1, '[1,2]'), | ||
41 | array(true, 2, '[1,2]'), | ||
42 | array(false, 1, ']1,2['), | ||
43 | array(false, 2, ']1,2['), | ||
44 | array(true, log(0), '[-Inf,2['), | ||
45 | array(true, -log(0), '[-2,+Inf]'), | ||
46 | ); | ||
47 | } | ||
48 | } | ||