Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 688
Zeile 112... Zeile 112...
112
 
112
 
113
        \Locale::setDefault('en');
113
        \Locale::setDefault('en');
114
        $this->assertEquals('en', $translator->getLocale());
114
        $this->assertEquals('en', $translator->getLocale());
Zeile 115... Zeile 115...
115
    }
115
    }
116
 
116
 
117
    public function getTransTests()
117
    public static function getTransTests()
118
    {
118
    {
119
        return [
119
        return [
120
            ['Symfony is great!', 'Symfony is great!', []],
120
            ['Symfony is great!', 'Symfony is great!', []],
121
            ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']],
121
            ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']],
Zeile 122... Zeile 122...
122
        ];
122
        ];
123
    }
123
    }
124
 
124
 
125
    public function getTransChoiceTests()
125
    public static function getTransChoiceTests()
126
    {
126
    {
127
        return [
127
        return [
Zeile 135... Zeile 135...
135
            ['There are 2 apples', 'There are 2 apples', 2],
135
            ['There are 2 apples', 'There are 2 apples', 2],
136
        ];
136
        ];
137
    }
137
    }
Zeile 138... Zeile 138...
138
 
138
 
139
    /**
139
    /**
140
     * @dataProvider getInternal
140
     * @dataProvider getInterval
141
     */
141
     */
142
    public function testInterval($expected, $number, $interval)
142
    public function testInterval($expected, $number, $interval)
143
    {
143
    {
Zeile 144... Zeile 144...
144
        $translator = $this->getTranslator();
144
        $translator = $this->getTranslator();
145
 
145
 
Zeile 146... Zeile 146...
146
        $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number]));
146
        $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number]));
147
    }
147
    }
148
 
148
 
149
    public function getInternal()
149
    public static function getInterval()
150
    {
150
    {
151
        return [
151
        return [
Zeile 187... Zeile 187...
187
        $translator = $this->getTranslator();
187
        $translator = $this->getTranslator();
Zeile 188... Zeile 188...
188
 
188
 
189
        $translator->trans($id, ['%count%' => $number]);
189
        $translator->trans($id, ['%count%' => $number]);
Zeile 190... Zeile 190...
190
    }
190
    }
191
 
191
 
192
    public function getNonMatchingMessages()
192
    public static function getNonMatchingMessages()
193
    {
193
    {
194
        return [
194
        return [
195
            ['{0} There are no apples|{1} There is one apple', 2],
195
            ['{0} There are no apples|{1} There is one apple', 2],
196
            ['{1} There is one apple|]1,Inf] There are %count% apples', 0],
196
            ['{1} There is one apple|]1,Inf] There are %count% apples', 0],
197
            ['{1} There is one apple|]2,Inf] There are %count% apples', 2],
197
            ['{1} There is one apple|]2,Inf] There are %count% apples', 2],
198
            ['{0} There are no apples|There is one apple', 2],
198
            ['{0} There are no apples|There is one apple', 2],
Zeile 199... Zeile 199...
199
        ];
199
        ];
200
    }
200
    }
201
 
201
 
202
    public function getChooseTests()
202
    public static function getChooseTests()
203
    {
203
    {
204
        return [
204
        return [
Zeile 313... Zeile 313...
313
    /**
313
    /**
314
     * This array should contain all currently known langcodes.
314
     * This array should contain all currently known langcodes.
315
     *
315
     *
316
     * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete.
316
     * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete.
317
     */
317
     */
318
    public function successLangcodes(): array
318
    public static function successLangcodes(): array
319
    {
319
    {
320
        return [
320
        return [
321
            ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']],
321
            ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']],
322
            ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']],
322
            ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']],
323
            ['3', ['be', 'bs', 'cs', 'hr']],
323
            ['3', ['be', 'bs', 'cs', 'hr']],
Zeile 332... Zeile 332...
332
     * This both depends on a complete list trying to add above as understanding
332
     * This both depends on a complete list trying to add above as understanding
333
     * the plural rules of the current failing languages.
333
     * the plural rules of the current failing languages.
334
     *
334
     *
335
     * @return array with nplural together with langcodes
335
     * @return array with nplural together with langcodes
336
     */
336
     */
337
    public function failingLangcodes(): array
337
    public static function failingLangcodes(): array
338
    {
338
    {
339
        return [
339
        return [
340
            ['1', ['fa']],
340
            ['1', ['fa']],
341
            ['2', ['jbo']],
341
            ['2', ['jbo']],
342
            ['3', ['cbs']],
342
            ['3', ['cbs']],