diff --git a/tests/i18n/i18nTest.php b/tests/i18n/i18nTest.php index cf0c9e07c..10f5baea4 100644 --- a/tests/i18n/i18nTest.php +++ b/tests/i18n/i18nTest.php @@ -224,8 +224,11 @@ class i18nTest extends SapphireTest { $oldLocale = i18n::get_locale(); 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"; $default = "Hello {name} {greeting}. But it is late, {goodbye}"; @@ -271,8 +274,10 @@ class i18nTest extends SapphireTest { $oldLocale = i18n::get_locale(); 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'); $viewer = new SSViewer('i18nTestModule'); $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", $parsedHtml, "Testing fallback to the translation default (but using the injection array)" ); + $this->assertContains( "TRANS Hello Paul good you are here. But it is late, see you\n", $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( "TRANS Hello Cat meow. But it is late, meow\n", diff --git a/tests/view/SSViewerTest.php b/tests/view/SSViewerTest.php index d0ec3f89a..d24454f28 100644 --- a/tests/view/SSViewerTest.php +++ b/tests/view/SSViewerTest.php @@ -461,7 +461,7 @@ after') $this->assertEquals( $this->render('<% include SSViewerTestIncludeWithArguments Arg1=A Bare String, Arg2=B Bare String %>'), - '

A Bare String

B Bare String

' + '

A Bare String

B Bare String

' ); $this->assertEquals(