2009-04-30 07:37:09 +00:00
|
|
|
<?php
|
2015-08-30 17:02:55 +12:00
|
|
|
|
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;
|
|
|
|
|
2016-06-15 16:03:16 +12:00
|
|
|
|
2015-08-30 17:02:55 +12:00
|
|
|
|
2009-04-30 07:37:09 +00:00
|
|
|
/**
|
2012-04-12 18:02:46 +12:00
|
|
|
* @package framework
|
2009-04-30 07:37:09 +00:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class DBLocaleTest extends SapphireTest {
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testNice() {
|
2015-08-30 17:02:55 +12:00
|
|
|
$l = DBField::create_field('Locale', 'de_DE');
|
2009-04-30 08:39:49 +00:00
|
|
|
$this->assertEquals($l->Nice(), 'German');
|
2009-04-30 07:37:09 +00:00
|
|
|
}
|
2014-08-15 18:53:05 +12:00
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testNiceNative() {
|
2015-08-30 17:02:55 +12:00
|
|
|
$l = DBField::create_field('Locale', 'de_DE');
|
2009-11-30 00:44:46 +00:00
|
|
|
$this->assertEquals($l->Nice(true), 'Deutsch');
|
|
|
|
}
|
2014-08-15 18:53:05 +12:00
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testNativeName() {
|
2015-08-30 17:02:55 +12:00
|
|
|
$l = DBField::create_field('Locale', 'de_DE');
|
2009-11-30 00:44:46 +00:00
|
|
|
$this->assertEquals($l->getNativeName(), 'Deutsch');
|
|
|
|
}
|
2009-04-30 07:37:09 +00:00
|
|
|
}
|