Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize route and raw_route, fix empty route as values #3184

Merged
merged 9 commits into from
Feb 8, 2021
Prev Previous commit
Next Next commit
fix text if language is found and is part as enabled languages
  • Loading branch information
pierrejoye committed Jan 31, 2021
commit 10be5d5a7cf4fb1f7e01c2e683c118857d1f00d3
8 changes: 4 additions & 4 deletions tests/unit/Grav/Common/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ public function testPathPrefixedByLangCode()
$arrayOfLanguages = ['en', 'de', 'it', 'es', 'dk', 'el'];
$languagesNotEnabled = array_diff($arrayOfLanguages, $languagesEnabled);
$oneLanguageNotEnabled = reset($languagesNotEnabled);
dump($oneLanguageNotEnabled);
dump($languagesNotEnabled);
dump($languagesEnabled);

if (count($languagesEnabled)) {
$this->assertTrue(Utils::pathPrefixedByLangCode('/' . $languagesEnabled[0] . '/test'));
$languageCodePathPrefix = Utils::pathPrefixedByLangCode('/' . $languagesEnabled[0] . '/test');
$this->assertIsString($languageCodePathPrefix);
$this->assertTrue(in_array($languageCodePathPrefix, $languagesEnabled));
}

$this->assertFalse(Utils::pathPrefixedByLangCode('/' . $oneLanguageNotEnabled . '/test'));
Expand Down