mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Changed i18nTextCollectorTest to only trigger _t() calls in instance methods (they don't fully work in __construct()). Manually adding ClassInfo state for the fakewebroot needed to test textcollection - ManifestBuilder/ClassInfo currently don't support setting of other webroots, or flexible inclusion/exclusion of certain subfolders which would be necessary to do this without hacks.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65023 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4ecb895b0a
commit
de7ed1aa3a
@ -1,20 +1,16 @@
|
||||
<?php
|
||||
class i18nTestModule extends Object {
|
||||
function __construct() {
|
||||
function myMethod() {
|
||||
_t(
|
||||
'i18nTestModule.ENTITY',
|
||||
'Entity with "Double Quotes"',
|
||||
PR_LOW,
|
||||
'Comment for entity'
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
class i18nTestModule_Addition extends Object {
|
||||
function __construct() {
|
||||
function myAdditionalMethod() {
|
||||
_t('i18nTestModule.ADDITION','Addition');
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
@ -30,6 +30,10 @@ class i18nTextCollectorTest extends SapphireTest {
|
||||
$_CLASS_MANIFEST['i18nTestModule'] = $this->alternateBasePath . '/i18ntestmodule/code/i18nTestModule.php';
|
||||
$_CLASS_MANIFEST['i18nTestModule_Addition'] = $this->alternateBasePath . '/i18ntestmodule/code/i18nTestModule.php';
|
||||
|
||||
global $_ALL_CLASSES;
|
||||
$_ALL_CLASSES['parents']['i18nTestModule'] = array('Object'=>'Object');
|
||||
$_ALL_CLASSES['parents']['i18nTestModule_Addition'] = array('Object'=>'Object');
|
||||
|
||||
global $_TEMPLATE_MANIFEST;
|
||||
$_TEMPLATE_MANIFEST['i18nTestModule.ss'] = array(
|
||||
'main' => $this->alternateBasePath . '/i18ntestmodule/templates/i18nTestModule.ss',
|
||||
|
Loading…
Reference in New Issue
Block a user