Skip to content

Update LocaleTest.php #8423

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/Symfony/Component/Locale/Tests/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,22 @@ public function testGetDisplayCountries()
$this->assertEquals('Brazil', $countries['BR']);
}

public function testGetDisplayCountriesForSwitzerland()
{
$countries = Locale::getDisplayCountries('de_CH');
$this->assertEquals('Schweiz', $countries['CH']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think to really cover the whole country set for CH, perhaps we can assert that the count is greater or equal than some number fetched from another display country set

}

public function testGetCountries()
{
$countries = Locale::getCountries();
$this->assertTrue(in_array('BR', $countries));
$this->assertContains('BR', $countries);
}

public function testGetCountriesForSwitzerland()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can merge this test with the one above testGetCountries as they can be together

$countries = Locale::getCountries();
        $this->assertContains('BR', $countries);
        $this->assertContains('CH', $countries);

{
$countries = Locale::getCountries();
$this->assertContains('CH', $countries);
}

public function testGetDisplayLanguages()
Expand All @@ -50,7 +62,7 @@ public function testGetDisplayLanguages()
public function testGetLanguages()
{
$languages = Locale::getLanguages();
$this->assertTrue(in_array('pt_BR', $languages));
$this->assertContains('pt_BR', $languages);
}

public function testGetDisplayLocales()
Expand All @@ -62,6 +74,6 @@ public function testGetDisplayLocales()
public function testGetLocales()
{
$locales = Locale::getLocales();
$this->assertTrue(in_array('pt', $locales));
$this->assertContains('pt', $locales);
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy