public function RequestTest::testIntlLocale

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php, line 1088

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIntlLocale() {
  if (!extension_loaded('intl')) {
    $this
      ->markTestSkipped('The intl extension is needed to run this test.');
  }
  $request = new Request();
  $request
    ->setDefaultLocale('fr');
  $this
    ->assertEquals('fr', $request
    ->getLocale());
  $this
    ->assertEquals('fr', \Locale::getDefault());
  $request
    ->setLocale('en');
  $this
    ->assertEquals('en', $request
    ->getLocale());
  $this
    ->assertEquals('en', \Locale::getDefault());
  $request
    ->setDefaultLocale('de');
  $this
    ->assertEquals('en', $request
    ->getLocale());
  $this
    ->assertEquals('en', \Locale::getDefault());
}