mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Added unit tests for i18nTextCollector handling of newlines in entity values
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65051 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0e71937ae6
commit
4f1d3913e1
@ -239,6 +239,39 @@ PHP;
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function testNewlinesInEntityValues() {
|
||||
$c = new i18nTextCollector();
|
||||
|
||||
$php = <<<PHP
|
||||
_t(
|
||||
'Test.NEWLINESINGLEQUOTE',
|
||||
'Line 1
|
||||
Line 2'
|
||||
);
|
||||
PHP;
|
||||
$this->assertEquals(
|
||||
$c->collectFromCode($php, 'mymodule'),
|
||||
array(
|
||||
'Test.NEWLINESINGLEQUOTE' => array("Line 1\nLine 2",null,null)
|
||||
)
|
||||
);
|
||||
|
||||
$php = <<<PHP
|
||||
_t(
|
||||
'Test.NEWLINEDOUBLEQUOTE',
|
||||
"Line 1
|
||||
Line 2"
|
||||
);
|
||||
PHP;
|
||||
$this->assertEquals(
|
||||
$c->collectFromCode($php, 'mymodule'),
|
||||
array(
|
||||
'Test.NEWLINEDOUBLEQUOTE' => array("Line 1\nLine 2",null,null)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Input for langArrayCodeForEntitySpec() should be suitable for insertion
|
||||
* into single-quoted strings, so needs to be escaped already.
|
||||
|
Loading…
Reference in New Issue
Block a user