-
Notifications
You must be signed in to change notification settings - Fork 1
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
1d7c9eb
commit 45a6855
Showing
7 changed files
with
73 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,9 @@ | |
"@cs:fix", | ||
"@phpstan", | ||
"@phpunit" | ||
], | ||
"post-install-cmd": [ | ||
"make upgrade-front" | ||
] | ||
|
||
}, | ||
|
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 |
---|---|---|
|
@@ -8,4 +8,8 @@ | |
|
||
final class MacopediaTranslatorBundle extends Bundle | ||
{ | ||
public function getParent() | ||
{ | ||
return null; | ||
} | ||
} |
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,48 @@ | ||
<?php | ||
|
||
namespace Translator; | ||
|
||
use InvalidArgumentException; | ||
use Macopedia\Translator\Translator\Language; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class LanguageTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider dataProvider | ||
* @param string $code | ||
* @param bool $correct | ||
*/ | ||
public function testCreateCorrectLanguage(string $code, bool $correct): void | ||
{ | ||
if (!$correct) { | ||
$this->expectException(InvalidArgumentException::class); | ||
} | ||
|
||
Language::fromCode($code); | ||
|
||
if ($correct) { | ||
$this->addToAssertionCount(1); | ||
} | ||
} | ||
|
||
/** | ||
* @return array<int, array<int, string|bool>> | ||
*/ | ||
public static function dataProvider(): array | ||
{ | ||
return [ | ||
['sg', true], | ||
['sa', true], | ||
['sc', true], | ||
['sr', true], | ||
['sn', true], | ||
['SN', false], | ||
['SR', false], | ||
['gb', false], | ||
['Pl', false], | ||
['pln', false], | ||
['pl_PL', false], | ||
]; | ||
} | ||
} |
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,3 @@ | ||
<?php | ||
|
||
require dirname(__DIR__) . '/vendor/autoload.php'; |