mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: fixes to i18n Unit Tests
This commit is contained in:
parent
65e3651ff4
commit
192237cb7d
@ -224,8 +224,11 @@ class i18nTest extends SapphireTest {
|
|||||||
$oldLocale = i18n::get_locale();
|
$oldLocale = i18n::get_locale();
|
||||||
|
|
||||||
i18n::set_locale('en_US');
|
i18n::set_locale('en_US');
|
||||||
$lang['en_US']['i18nTestModule']['NEWMETHODSIG'] = 'TRANS New _t method signature test';
|
|
||||||
$lang['en_US']['i18nTestModule']['INJECTIONS'] = 'TRANS Hello {name} {greeting}. But it is late, {goodbye}';
|
i18n::get_translator('core')->getAdapter()->addTranslation(array(
|
||||||
|
'i18nTestModule.NEWMETHODSIG' => 'TRANS New _t method signature test',
|
||||||
|
'i18nTestModule.INJECTIONS' => 'TRANS Hello {name} {greeting}. But it is late, {goodbye}'
|
||||||
|
), 'en_US');
|
||||||
|
|
||||||
$entity = "i18nTestModule.INJECTIONS";
|
$entity = "i18nTestModule.INJECTIONS";
|
||||||
$default = "Hello {name} {greeting}. But it is late, {goodbye}";
|
$default = "Hello {name} {greeting}. But it is late, {goodbye}";
|
||||||
@ -271,8 +274,10 @@ class i18nTest extends SapphireTest {
|
|||||||
$oldLocale = i18n::get_locale();
|
$oldLocale = i18n::get_locale();
|
||||||
|
|
||||||
i18n::set_locale('en_US');
|
i18n::set_locale('en_US');
|
||||||
$lang['en_US']['i18nTestModule']['NEWMETHODSIG'] = 'TRANS New _t method signature test';
|
i18n::get_translator('core')->getAdapter()->addTranslation(array(
|
||||||
$lang['en_US']['i18nTestModule']['INJECTIONS'] = 'TRANS Hello {name} {greeting}. But it is late, {goodbye}';
|
'i18nTestModule.NEWMETHODSIG' => 'TRANS New _t method signature test',
|
||||||
|
'i18nTestModule.INJECTIONS' => 'TRANS Hello {name} {greeting}. But it is late, {goodbye}'
|
||||||
|
),'en_US');
|
||||||
|
|
||||||
$viewer = new SSViewer('i18nTestModule');
|
$viewer = new SSViewer('i18nTestModule');
|
||||||
$parsedHtml = $viewer->process(new ArrayData(array('TestProperty' => 'TestPropertyValue')));
|
$parsedHtml = $viewer->process(new ArrayData(array('TestProperty' => 'TestPropertyValue')));
|
||||||
@ -280,14 +285,11 @@ class i18nTest extends SapphireTest {
|
|||||||
"Hello Mark welcome. But it is late, bye\n",
|
"Hello Mark welcome. But it is late, bye\n",
|
||||||
$parsedHtml, "Testing fallback to the translation default (but using the injection array)"
|
$parsedHtml, "Testing fallback to the translation default (but using the injection array)"
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
"TRANS Hello Paul good you are here. But it is late, see you\n",
|
"TRANS Hello Paul good you are here. But it is late, see you\n",
|
||||||
$parsedHtml, "Testing entity, default string and injection array"
|
$parsedHtml, "Testing entity, default string and injection array"
|
||||||
);
|
);
|
||||||
$this->assertContains(
|
|
||||||
"TRANS Hello Steffen willkommen. But it is late, wiedersehen\n",
|
|
||||||
$parsedHtml, "Full test of translation, using default, context and injection array"
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
"TRANS Hello Cat meow. But it is late, meow\n",
|
"TRANS Hello Cat meow. But it is late, meow\n",
|
||||||
|
@ -461,7 +461,7 @@ after')
|
|||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$this->render('<% include SSViewerTestIncludeWithArguments Arg1=A Bare String, Arg2=B Bare String %>'),
|
$this->render('<% include SSViewerTestIncludeWithArguments Arg1=A Bare String, Arg2=B Bare String %>'),
|
||||||
'<p>A Bare String</p><p>B Bare String</p>'
|
'<p>A Bare String</p><p>B Bare String </p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user