function UserPasswordResetTest::languagePrefixTestProvider

Same name in other branches
  1. 10 core/modules/user/tests/src/Functional/UserPasswordResetTest.php \Drupal\Tests\user\Functional\UserPasswordResetTest::languagePrefixTestProvider()
  2. 11.x core/modules/user/tests/src/Functional/UserPasswordResetTest.php \Drupal\Tests\user\Functional\UserPasswordResetTest::languagePrefixTestProvider()

Data provider for testUserPasswordResetPreferredLanguage().

Return value

array

File

core/modules/user/tests/src/Functional/UserPasswordResetTest.php, line 282

Class

UserPasswordResetTest
Ensure that password reset methods work as expected.

Namespace

Drupal\Tests\user\Functional

Code

public function languagePrefixTestProvider() {
    return [
        'Test language prefix set as \'\', visiting default with preferred language as en' => [
            'setPreferredLangcode' => 'en',
            'activeLangcode' => 'en',
            'prefix' => '',
            'visitingUrl' => 'user/password',
            'expectedResetUrl' => 'user/reset',
            'unexpectedResetUrl' => 'en/user/reset',
        ],
        'Test language prefix set as fr, visiting zh with preferred language as fr' => [
            'setPreferredLangcode' => 'fr',
            'activeLangcode' => 'fr',
            'prefix' => 'fr',
            'visitingUrl' => 'zh/user/password',
            'expectedResetUrl' => 'fr/user/reset',
            'unexpectedResetUrl' => 'zh/user/reset',
        ],
        'Test language prefix set as zh, visiting zh with preferred language as \'\'' => [
            'setPreferredLangcode' => '',
            'activeLangcode' => 'zh-hant',
            'prefix' => 'zh',
            'visitingUrl' => 'zh/user/password',
            'expectedResetUrl' => 'user/reset',
            'unexpectedResetUrl' => 'zh/user/reset',
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.