diff --git a/tests/Unit/Currency/CurrencyAlpha3Test.php b/tests/Unit/Currency/CurrencyAlpha3Test.php index 274b9cea..9e64783a 100644 --- a/tests/Unit/Currency/CurrencyAlpha3Test.php +++ b/tests/Unit/Currency/CurrencyAlpha3Test.php @@ -44,6 +44,22 @@ public function testAllCasesCanBeConvertedToCurrencyName(): void } } + /** + * @covers ::getSymbol + */ + public function testAllCasesHaveAccessToSymbolOrNull(): void + { + $cases = CurrencyAlpha3::cases(); + static::assertNotEmpty($cases); + foreach ($cases as $case) { + try { + $case->getSymbol(); + } catch (TypeError) { + $this->fail(sprintf('Unable to retrieve symbol for %s', $case->name)); + } + } + } + /** * @covers ::lowerCaseValue */ diff --git a/tests/Unit/Currency/CurrencyNameTest.php b/tests/Unit/Currency/CurrencyNameTest.php index eca33fe6..c83d37eb 100644 --- a/tests/Unit/Currency/CurrencyNameTest.php +++ b/tests/Unit/Currency/CurrencyNameTest.php @@ -28,6 +28,22 @@ public function testAllCasesCanBeConvertedToCurrencyNumeric(): void } } + /** + * @covers ::getSymbol + */ + public function testAllCasesHaveAccessToSymbolOrNull(): void + { + $cases = CurrencyName::cases(); + static::assertNotEmpty($cases); + foreach ($cases as $case) { + try { + $case->getSymbol(); + } catch (TypeError) { + $this->fail(sprintf('Unable to retrieve symbol for %s', $case->name)); + } + } + } + /** * @covers ::toCurrencyAlpha3 */ diff --git a/tests/Unit/Currency/CurrencyNumericTest.php b/tests/Unit/Currency/CurrencyNumericTest.php index 49e1a1f4..c1e8367f 100644 --- a/tests/Unit/Currency/CurrencyNumericTest.php +++ b/tests/Unit/Currency/CurrencyNumericTest.php @@ -45,6 +45,22 @@ public function testAllCasesCanBeConvertedToCurrencyName(): void } } + /** + * @covers ::getSymbol + */ + public function testAllCasesHaveAccessToSymbolOrNull(): void + { + $cases = CurrencyNumeric::cases(); + static::assertNotEmpty($cases); + foreach ($cases as $case) { + try { + $case->getSymbol(); + } catch (TypeError) { + $this->fail(sprintf('Unable to retrieve symbol for %s', $case->name)); + } + } + } + /** * @covers ::fromInt */ diff --git a/tests/Unit/Currency/CurrencySymbolTest.php b/tests/Unit/Currency/CurrencySymbolTest.php new file mode 100644 index 00000000..87aef4b1 --- /dev/null +++ b/tests/Unit/Currency/CurrencySymbolTest.php @@ -0,0 +1,64 @@ +getSymbol(); + } catch (TypeError) { + $this->fail(sprintf('Unable to retrieve symbol for %s', $case->name)); + } + } + } + + /** + * @covers ::getSymbol + */ + public function testAllNameCasesHaveAccessToSymbolOrNull(): void + { + $cases = CurrencyName::cases(); + static::assertNotEmpty($cases); + foreach ($cases as $case) { + try { + $case->getSymbol(); + } catch (TypeError) { + $this->fail(sprintf('Unable to retrieve symbol for %s', $case->name)); + } + } + } + + /** + * @covers ::getSymbol + */ + public function testAllNumericCasesHaveAccessToSymbolOrNull(): void + { + $cases = CurrencyNumeric::cases(); + static::assertNotEmpty($cases); + foreach ($cases as $case) { + try { + $case->getSymbol(); + } catch (TypeError) { + $this->fail(sprintf('Unable to retrieve symbol for %s', $case->name)); + } + } + } +}