Skip to content

Commit

Permalink
Issue #96 Add tests with disabled detection / persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehaertl committed Mar 23, 2017
1 parent b124fc8 commit 9afafc5
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/RedirectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,52 @@ class RedirectTest extends TestCase
],
],

// No persistence / detection
[
'urlManager' => [
'languages' => ['en-US', 'en', 'de', 'pt', 'at' => 'de-AT', 'alias' => 'fr', 'es-BO', 'wc-*'],
'enableLanguageDetection' => false,
'enableLanguagePersistence' => false,
],
'redirects' => [
'/' => [
[false],
[false,
'session' => ['_language' => 'de'],
'cookie' => ['_language' => 'fr'],
'request' => ['acceptableLanguages' => ['pt']],
],
],
'/site/page' => [
[false],
[false,
'session' => ['_language' => 'de'],
'cookie' => ['_language' => 'fr'],
'request' => ['acceptableLanguages' => ['pt']],
],
],
'/de' => [
[false],
[false,
'session' => ['_language' => 'en'],
'cookie' => ['_language' => 'fr'],
'request' => ['acceptableLanguages' => ['pt']],
],
],
'/de/site/page' => [
[false],
[false,
'session' => ['_language' => 'en'],
'cookie' => ['_language' => 'fr'],
'request' => ['acceptableLanguages' => ['pt']],
],
],
'/en' => '/',
'/en/site/page' => '/site/page',
],
],


// Suffix in UrlManager, with + w/o URL code for default language
[
'urlManager' => [
Expand Down

0 comments on commit 9afafc5

Please sign in to comment.