diff options
author | Stefan Parviainen <saparvia@caterva.eu> | 2014-12-31 10:42:08 +0100 |
---|---|---|
committer | Stefan Parviainen <saparvia@caterva.eu> | 2014-12-31 10:42:08 +0100 |
commit | 7bf7f8180dbc3a89824815de3bc1e4f40857d2f6 (patch) | |
tree | 34e51239e753204989af7d82793c24bb3b304ecb /library/intl/tests/Language/LanguageTest.php | |
parent | 24a16434bccb7b41d026767f81ffe5f060d566bf (diff) | |
download | volse-hubzilla-7bf7f8180dbc3a89824815de3bc1e4f40857d2f6.tar.gz volse-hubzilla-7bf7f8180dbc3a89824815de3bc1e4f40857d2f6.tar.bz2 volse-hubzilla-7bf7f8180dbc3a89824815de3bc1e4f40857d2f6.zip |
Revert "Revert "Language names via intl library.""
This reverts commit 4f35efa0bad4ae6489b63f3eebafe6542d654094.
Diffstat (limited to 'library/intl/tests/Language/LanguageTest.php')
-rw-r--r-- | library/intl/tests/Language/LanguageTest.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/library/intl/tests/Language/LanguageTest.php b/library/intl/tests/Language/LanguageTest.php new file mode 100644 index 000000000..037483c88 --- /dev/null +++ b/library/intl/tests/Language/LanguageTest.php @@ -0,0 +1,53 @@ +<?php + +namespace CommerceGuys\Intl\Tests\Language; + +use CommerceGuys\Intl\Language\Language; + +/** + * @coversDefaultClass \CommerceGuys\Intl\Language\Language + */ +class LanguageTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Language + */ + protected $language; + + public function setUp() + { + $this->language = new Language(); + } + + /** + * @covers ::getLanguageCode + * @covers ::setLanguageCode + * @covers ::__toString + */ + public function testLanguageCode() + { + $this->language->setLanguageCode('en'); + $this->assertEquals('en', $this->language->getLanguageCode()); + $this->assertEquals('en', (string) $this->language); + } + + /** + * @covers ::getName + * @covers ::setName + */ + public function testName() + { + $this->language->setName('English'); + $this->assertEquals('English', $this->language->getName()); + } + + /** + * @covers ::getLocale + * @covers ::setLocale + */ + public function testLocale() + { + $this->language->setLocale('en'); + $this->assertEquals('en', $this->language->getLocale()); + } +} |