Skip to content

Commit 0d80dfa

Browse files
committed
drop useless assertCountry() assertion
1 parent c46951a commit 0d80dfa

File tree

3 files changed

+0
-38
lines changed

3 files changed

+0
-38
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ This will prevent any method name conflicts with core, your custom or other trai
2727
`composer require --dev league/iso3166`
2828

2929
```php
30-
\Astrotomic\PhpunitAssertions\CountryAssertions::assertCountry('DE', \League\ISO3166\ISO3166::KEY_ALPHA2);
3130
\Astrotomic\PhpunitAssertions\CountryAssertions::assertCountryName('Germany');
3231
\Astrotomic\PhpunitAssertions\CountryAssertions::assertCountryAlpha2('DE');
3332
\Astrotomic\PhpunitAssertions\CountryAssertions::assertCountryAlpha3('DEU');

src/CountryAssertions.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,6 @@
88

99
trait CountryAssertions
1010
{
11-
public static function assertCountry($actual, string $key): void
12-
{
13-
switch ($key) {
14-
case ISO3166::KEY_NAME:
15-
self::assertCountryName($actual);
16-
break;
17-
case ISO3166::KEY_ALPHA2:
18-
self::assertCountryAlpha2($actual);
19-
break;
20-
case ISO3166::KEY_ALPHA3:
21-
self::assertCountryAlpha3($actual);
22-
break;
23-
case ISO3166::KEY_NUMERIC:
24-
self::assertCountryNumeric($actual);
25-
break;
26-
default:
27-
throw new OutOfBoundsException();
28-
}
29-
}
30-
3111
public static function assertCountryName($actual): void
3212
{
3313
PHPUnit::assertIsString($actual);

tests/CountryAssertionsTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77

88
final class CountryAssertionsTest extends TestCase
99
{
10-
/**
11-
* @test
12-
* @dataProvider countries
13-
*/
14-
public static function it_can_validate_country(string $name, string $alpha2, string $alpha3, string $numeric): void
15-
{
16-
CountryAssertions::assertCountry($name, ISO3166::KEY_NAME);
17-
CountryAssertions::assertCountry($alpha2, ISO3166::KEY_ALPHA2);
18-
CountryAssertions::assertCountry($alpha3, ISO3166::KEY_ALPHA3);
19-
CountryAssertions::assertCountry($numeric, ISO3166::KEY_NUMERIC);
20-
}
21-
2210
/**
2311
* @test
2412
* @dataProvider countryName
@@ -55,11 +43,6 @@ public static function it_can_validate_country_by_numeric(string $actual): void
5543
CountryAssertions::assertCountryNumeric($actual);
5644
}
5745

58-
public function countries(): iterable
59-
{
60-
return (new ISO3166())->all();
61-
}
62-
6346
public function countryName(): iterable
6447
{
6548
return array_map(fn (array $country): array => [$country[ISO3166::KEY_NAME]], (new ISO3166())->all());

0 commit comments

Comments
 (0)