Skip to content

Commit

Permalink
Merge pull request #70 from Pod-Point/v3.2.1
Browse files Browse the repository at this point in the history
v3.2.1 - add spain (and france) as supported countries
  • Loading branch information
thomasmichaelwallace authored May 23, 2024
2 parents 4672e6c + ed0a817 commit e30d47e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
Expand Down
4 changes: 4 additions & 0 deletions src/CountryCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class CountryCode
const UNITED_KINGDOM = 'GB';
const IRELAND = 'IE';
const NORWAY = 'NO';
const SPAIN = 'ES';
const FRANCE = 'FR';

/**
* Retrieves all supported country codes.
Expand All @@ -22,6 +24,8 @@ public static function all(): array
self::UNITED_KINGDOM,
self::IRELAND,
self::NORWAY,
self::SPAIN,
self::FRANCE,
];
}
}
14 changes: 14 additions & 0 deletions src/config/countries-partial.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,18 @@
'tld' => 'no',
'timezone' => 'Europe/Oslo',
],
CountryCode::SPAIN => [
'locale' => 'es',
'systemLocale' => 'es_ES.UTF-8',
'language' => 'SPA',
'tld' => 'es',
'timezone' => 'Europe/Madrid',
],
CountryCode::FRANCE => [
'locale' => 'fr',
'systemLocale' => 'fr_FR.UTF-8',
'language' => 'FRA',
'tld' => 'fr',
'timezone' => 'Europe/Paris',
],
];
7 changes: 5 additions & 2 deletions tests/Unit/Providers/CountriesServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ public function testPartialCountriesConfigHasOnlySupportedCountriesAndLocales()

$countryCodes = array_keys($this->app->config->get('countries-partial'));

$this->assertEquals(CountryCode::all(), $countryCodes);
$countryCodeAll = CountryCode::all();
sort($countryCodeAll);
sort($countryCodes);
$this->assertEquals($countryCodeAll, $countryCodes);

collect($this->app->config->get('countries-partial'))->each(function ($country) {
$supportedLocales = ['en', 'no', 'ie'];
$supportedLocales = ['es', 'fr', 'en', 'ie', 'no'];

if (isset($country['locale'])) {
$this->assertTrue(in_array($country['locale'], $supportedLocales));
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ViewComposers/CountryLocaleViewComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public function testCompose()
'en' => 'ENG',
'no' => 'NOR',
'ie' => 'ENG',
'es' => 'SPA',
'fr' => 'FRA',
],
]);

Expand Down

0 comments on commit e30d47e

Please sign in to comment.