You are here

function SecurepagesTest::_testLocale in Secure Pages 8

Tests correct operation with locale module.

1 call to SecurepagesTest::_testLocale()
SecurepagesTest::testSecurePages in src/Tests/SecurepagesTest.php
Runs all the tests in a sequence to avoid multiple re-installs.

File

src/Tests/SecurepagesTest.php, line 109
Contains \Drupal\securepages\Tests\SecurepagesTest.

Class

SecurepagesTest
Test Secure Pages redirects.

Namespace

Drupal\securepages\Tests

Code

function _testLocale() {
  $french = ConfigurableLanguage::createFromLangcode('fr');
  $french
    ->save();
  $this
    ->drupalGet('fr/user');
  $this
    ->assertResponse(200);
  $this
    ->assertUrl(Url::fromRoute('<front>', [], [
    'https' => TRUE,
    'absolute' => TRUE,
  ])
    ->toString() . 'fr/user/login');
  $this
    ->assertTrue(strstr($this->url, 'fr/user'), t('URL contains language prefix.'));
}