4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Translation\Tests
;
14 use Symfony\Component\Translation\Interval
;
16 class IntervalTest
extends \PHPUnit_Framework_TestCase
19 * @dataProvider getTests
21 public function testTest($expected, $number, $interval)
23 $this->assertEquals($expected, Interval
::test($number, $interval));
27 * @expectedException \InvalidArgumentException
29 public function testTestException()
31 Interval
::test(1, 'foobar');
34 public function getTests()
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]'),