You are here

public function RequestTest::testIntlLocale in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestTest.php \Symfony\Component\HttpFoundation\Tests\RequestTest::testIntlLocale()

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 1263

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());
}