File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
src/Symfony/Component/Form
Tests/Extension/Core/Type Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Form \Extension \Core \Type ;
13
13
14
14
use Symfony \Component \Form \AbstractType ;
15
+ use Symfony \Component \Intl \Intl ;
15
16
use Symfony \Component \Locale \Locale ;
16
17
use Symfony \Component \OptionsResolver \OptionsResolverInterface ;
17
18
@@ -23,7 +24,7 @@ class CountryType extends AbstractType
23
24
public function setDefaultOptions (OptionsResolverInterface $ resolver )
24
25
{
25
26
$ resolver ->setDefaults (array (
26
- 'choices ' => Locale:: getDisplayCountries (\Locale::getDefault ()),
27
+ 'choices ' => Intl:: getRegionBundle ()-> getCountryNames (\Locale::getDefault ()),
27
28
));
28
29
}
29
30
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Form \Extension \Core \Type ;
13
13
14
14
use Symfony \Component \Form \AbstractType ;
15
+ use Symfony \Component \Intl \Intl ;
15
16
use Symfony \Component \Locale \Locale ;
16
17
use Symfony \Component \OptionsResolver \OptionsResolverInterface ;
17
18
@@ -23,7 +24,7 @@ class LanguageType extends AbstractType
23
24
public function setDefaultOptions (OptionsResolverInterface $ resolver )
24
25
{
25
26
$ resolver ->setDefaults (array (
26
- 'choices ' => Locale:: getDisplayLanguages (\Locale::getDefault ()),
27
+ 'choices ' => Intl:: getLanguageBundle ()-> getLanguageNames (\Locale::getDefault ()),
27
28
));
28
29
}
29
30
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Form \Extension \Core \Type ;
13
13
14
14
use Symfony \Component \Form \AbstractType ;
15
+ use Symfony \Component \Intl \Intl ;
15
16
use Symfony \Component \Locale \Locale ;
16
17
use Symfony \Component \OptionsResolver \OptionsResolverInterface ;
17
18
@@ -23,7 +24,7 @@ class LocaleType extends AbstractType
23
24
public function setDefaultOptions (OptionsResolverInterface $ resolver )
24
25
{
25
26
$ resolver ->setDefaults (array (
26
- 'choices ' => Locale:: getDisplayLocales (\Locale::getDefault ()),
27
+ 'choices ' => Intl:: getLocaleBundle ()-> getLocaleNames (\Locale::getDefault ()),
27
28
));
28
29
}
29
30
Original fil
10000
e line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Form \Tests \Extension \Core \Type ;
13
13
14
+ use Symfony \Component \Intl \Intl ;
15
+
14
16
abstract class LocalizedTestCase extends TypeTestCase
15
17
{
16
18
protected function setUp ()
17
19
{
18
20
parent ::setUp ();
19
21
20
- if (!class_exists ('Symfony\Component\Locale\Locale ' )) {
21
- $ this ->markTestSkipped ('The "Locale " component is not available ' );
22
+ if (!class_exists ('Symfony\Component\Intl\Intl ' )) {
23
+ $ this ->markTestSkipped ('The "Intl " component is not available ' );
22
24
}
23
25
24
- if (!extension_loaded ( ' intl ' )) {
26
+ if (!Intl:: isExtensionLoaded ( )) {
25
27
$ this ->markTestSkipped ('The "intl" extension is not available ' );
26
28
}
29
+
30
+ Intl::setDataSource (Intl::STUB );
31
+
32
+ \Locale::setDefault ('en ' );
27
33
}
28
34
}
Original file line number Diff line number Diff line change 18
18
"require" : {
19
19
"php" : " >=5.3.3" ,
20
20
"symfony/event-dispatcher" : " ~2.1" ,
21
- "symfony/locale " : " ~2.0 " ,
21
+ "symfony/intl " : " ~2.3 " ,
22
22
"symfony/options-resolver" : " >=2.1,<2.4-dev" ,
23
23
"symfony/property-access" : " >=2.2,<2.4-dev"
24
24
},
You can’t perform that action at this time.
0 commit comments