File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 77 runs-on : ubuntu-latest
88
99 steps :
10- - uses : actions/checkout@v3
10+ - uses : actions/checkout@v5
1111 - uses : php-actions/composer@v6
12- - uses : php-actions/phpunit@v3
12+ - uses : php-actions/phpunit@v4
1313 with :
1414 configuration : ./phpunit.xml
1515 php_version : 7.4
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ class CountryHelper
4444 public static function getCountry ($ code , $ default = null )
4545 {
4646 $ code = $ code ?: $ default ;
47+ if (is_string ($ code ))
48+ {
49+ $ code = strtoupper ($ code );
50+ }
4751 $ className = sprintf ('\Packaged\Rwd\Country\Countries\%sCountry ' , $ code );
4852 if (class_exists ($ className ))
4953 {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Packaged \Tests \Rwd \Country ;
4+
5+ use Packaged \Rwd \Country \CountryHelper ;
6+ use PHPUnit \Framework \TestCase ;
7+
8+ class CountryTest extends TestCase
9+ {
10+ public function testCountryLowercase ()
11+ {
12+ $ us = CountryHelper::getCountry ('us ' );
13+ self ::assertEquals ('United States ' , $ us ->getName ());
14+
15+ $ us = CountryHelper::getCountry ('US ' );
16+ self ::assertEquals ('United States ' , $ us ->getName ());
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments