]>
Commit | Line | Data |
---|---|---|
4f5b44bd NL |
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\Intl\Tests\NumberFormatter\Verification; | |
13 | ||
14 | use Symfony\Component\Intl\Tests\NumberFormatter\AbstractNumberFormatterTest; | |
15 | use Symfony\Component\Intl\Util\IntlTestHelper; | |
16 | ||
17 | /** | |
18 | * Note that there are some values written like -2147483647 - 1. This is the lower 32bit int max and is a known | |
19 | * behavior of PHP. | |
20 | */ | |
21 | class NumberFormatterTest extends AbstractNumberFormatterTest | |
22 | { | |
23 | protected function setUp() | |
24 | { | |
25 | IntlTestHelper::requireFullIntl($this); | |
26 | ||
27 | parent::setUp(); | |
28 | } | |
29 | ||
30 | public function testCreate() | |
31 | { | |
32 | $this->assertInstanceOf('\NumberFormatter', \NumberFormatter::create('en', \NumberFormatter::DECIMAL)); | |
33 | } | |
34 | ||
35 | protected function getNumberFormatter($locale = 'en', $style = null, $pattern = null) | |
36 | { | |
37 | return new \NumberFormatter($locale, $style, $pattern); | |
38 | } | |
39 | ||
40 | protected function getIntlErrorMessage() | |
41 | { | |
42 | return intl_get_error_message(); | |
43 | } | |
44 | ||
45 | protected function getIntlErrorCode() | |
46 | { | |
47 | return intl_get_error_code(); | |
48 | } | |
49 | ||
50 | protected function isIntlFailure($errorCode) | |
51 | { | |
52 | return intl_is_failure($errorCode); | |
53 | } | |
54 | } |