-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b72f10a
commit 7bfb804
Showing
4 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace PrinsFrank\Standards\Tests\Unit\Currency; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use PrinsFrank\Standards\Currency\CurrencyAlpha3; | ||
use PrinsFrank\Standards\Currency\CurrencyName; | ||
use PrinsFrank\Standards\Currency\CurrencyNumeric; | ||
use TypeError; | ||
|
||
/** | ||
* @coversDefaultClass \PrinsFrank\Standards\Currency\CurrencySymbol | ||
*/ | ||
class CurrencySymbolTest extends TestCase | ||
{ | ||
/** | ||
* @covers ::getSymbol | ||
*/ | ||
public function testAllAlpha3CasesHaveAccessToSymbolOrNull(): 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 ::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)); | ||
} | ||
} | ||
} | ||
} |