silverstripe-framework/tests/php/ORM/DBLocaleTest.php

46 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2016-10-14 03:30:05 +02:00
namespace SilverStripe\ORM\Tests;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\ORM\FieldType\DBLocale;
class DBLocaleTest extends SapphireTest
{
public function testNice()
{
/** @var DBLocale $locale */
$locale = DBField::create_field('Locale', 'de_DE');
$this->assertEquals('German', $locale->Nice());
}
2014-08-15 08:53:05 +02:00
public function testNiceNative()
{
/** @var DBLocale $locale */
$locale = DBField::create_field('Locale', 'de_DE');
$this->assertEquals('Deutsch', $locale->Nice(true));
}
2014-08-15 08:53:05 +02:00
public function testNativeName()
{
/** @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());
}
}