File: CategoryTest.php

package info (click to toggle)
php-gettext-languages 2.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 476 kB
  • sloc: php: 1,358; makefile: 12; xml: 10
file content (32 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Gettext\Languages\Test;

use Gettext\Languages\Category;

class CategoryTest extends TestCase
{
    public function testConstructorWithInvalidClderId()
    {
        $this->isGoingToThrowException('\Exception');
        new Category('invalid-cldr-category', 'i = 1 and v = 0 @integer 1');
    }

    public function testConstructorOnCldrIdIsNotInList()
    {
        $this->isGoingToThrowException('\Exception');
        new Category('pluralRule-count-10000000', 'i = 1 and v = 0 @integer 1');
    }

    public function testConstructorWithInvalidCldrRule()
    {
        $this->isGoingToThrowException('\Exception');
        new Category('pluralRule-count-one', 'invalid category rule');
    }

    public function testGetExampleIntegers()
    {
        $category = new Category('pluralRule-count-one', 'i = 1 and v = 0 @integer 1');
        $this->assertSame(array(1), $category->getExampleIntegers());
    }
}