-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.1.x' of github.com:baserproject/basercms into 5.1.x
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace BaserCore\Test\TestCase\Utility; | ||
|
||
use BaserCore\TestSuite\BcTestCase; | ||
use BaserCore\Utility\BcLang; | ||
|
||
class BcLangTest extends BcTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
|
||
public function testSetConfig() | ||
{ | ||
$this->markTestIncomplete('このテストは、まだ実装されていません。'); | ||
} | ||
|
||
public function testGetDefaultConfig() | ||
{ | ||
$this->markTestIncomplete('このテストは、まだ実装されていません。'); | ||
} | ||
|
||
public function testGetPattern() | ||
{ | ||
$this->markTestIncomplete('このテストは、まだ実装されていません。'); | ||
} | ||
|
||
/** | ||
* Test parseLang | ||
* @dataProvider parseLangDataProvider | ||
*/ | ||
public function testParseLang($acceptLanguage, $expected) | ||
{ | ||
$result = BcLang::parseLang($acceptLanguage); | ||
$this->assertEquals($expected, $result); | ||
} | ||
|
||
public static function parseLangDataProvider() | ||
{ | ||
return [ | ||
[null, 'ja'], | ||
['', 'ja'], | ||
['en-US', 'en'], | ||
['fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5', 'fr'], | ||
['en-US,en;q=0.9', 'en'], | ||
['zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7', 'zh'], | ||
['en-US,en;q=0.8,es-ES;q=0.5,es;q=0.3', 'en'], | ||
['123,456', '123'], | ||
]; | ||
} | ||
} |