diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4a25a8..dd02dd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - uses: php-actions/composer@v6 - - uses: php-actions/phpunit@v3 + - uses: php-actions/phpunit@v4 with: configuration: ./phpunit.xml php_version: 7.4 diff --git a/src/Country/CountryHelper.php b/src/Country/CountryHelper.php index e6aca0f..0ec54f6 100644 --- a/src/Country/CountryHelper.php +++ b/src/Country/CountryHelper.php @@ -44,6 +44,10 @@ class CountryHelper public static function getCountry($code, $default = null) { $code = $code ?: $default; + if(is_string($code)) + { + $code = strtoupper($code); + } $className = sprintf('\Packaged\Rwd\Country\Countries\%sCountry', $code); if(class_exists($className)) { diff --git a/tests/Country/CountryTest.php b/tests/Country/CountryTest.php new file mode 100644 index 0000000..9c9e57d --- /dev/null +++ b/tests/Country/CountryTest.php @@ -0,0 +1,18 @@ +getName()); + + $us = CountryHelper::getCountry('US'); + self::assertEquals('United States', $us->getName()); + } +}