2009-04-30 07:37:09 +00:00
|
|
|
<?php
|
2015-08-30 17:02:55 +12:00
|
|
|
|
2016-10-14 14:30:05 +13:00
|
|
|
namespace SilverStripe\ORM\Tests;
|
2016-06-15 16:03:16 +12:00
|
|
|
|
|
|
|
use SilverStripe\ORM\FieldType\DBField;
|
2016-08-19 10:51:35 +12:00
|
|
|
use SilverStripe\Dev\SapphireTest;
|
2017-01-26 17:20:08 +13:00
|
|
|
use SilverStripe\ORM\FieldType\DBLocale;
|
2016-08-19 10:51:35 +12:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
class DBLocaleTest extends SapphireTest
|
|
|
|
{
|
|
|
|
public function testNice()
|
|
|
|
{
|
2017-01-26 17:20:08 +13:00
|
|
|
/** @var DBLocale $locale */
|
|
|
|
$locale = DBField::create_field('Locale', 'de_DE');
|
|
|
|
$this->assertEquals('German', $locale->Nice());
|
2016-12-16 17:34:21 +13:00
|
|
|
}
|
2014-08-15 18:53:05 +12:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
public function testNiceNative()
|
|
|
|
{
|
2017-01-26 17:20:08 +13:00
|
|
|
/** @var DBLocale $locale */
|
|
|
|
$locale = DBField::create_field('Locale', 'de_DE');
|
|
|
|
$this->assertEquals('Deutsch', $locale->Nice(true));
|
2016-12-16 17:34:21 +13:00
|
|
|
}
|
2014-08-15 18:53:05 +12:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
public function testNativeName()
|
|
|
|
{
|
2017-01-26 17:20:08 +13:00
|
|
|
/** @var DBLocale $locale */
|
|
|
|
$locale = DBField::create_field('Locale', 'de_DE');
|
|
|
|
$this->assertEquals('Deutsch', $locale->getNativeName());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testShortName()
|
|
|
|
{
|
|
|
|
/** @var DBLocale $locale */
|
|
|
|
$locale = DBField::create_field('Locale', 'de_DE');
|
|
|
|
$this->assertEquals('German', $locale->getShortName());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testLongName()
|
|
|
|
{
|
|
|
|
/** @var DBLocale $locale */
|
|
|
|
$locale = DBField::create_field('Locale', 'de_DE');
|
|
|
|
$this->assertEquals('German (Germany)', $locale->getLongName());
|
2016-12-16 17:34:21 +13:00
|
|
|
}
|
2009-04-30 07:37:09 +00:00
|
|
|
}
|