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:
Ingo Schommer 2008-11-01 13:40:00 +00:00
parent 4ecb895b0a
commit de7ed1aa3a
2 changed files with 6 additions and 6 deletions

View File

@ -1,20 +1,16 @@
<?php <?php
class i18nTestModule extends Object { class i18nTestModule extends Object {
function __construct() { function myMethod() {
_t( _t(
'i18nTestModule.ENTITY', 'i18nTestModule.ENTITY',
'Entity with "Double Quotes"', 'Entity with "Double Quotes"',
PR_LOW, PR_LOW,
'Comment for entity' 'Comment for entity'
); );
parent::__construct();
} }
} }
class i18nTestModule_Addition extends Object { class i18nTestModule_Addition extends Object {
function __construct() { function myAdditionalMethod() {
_t('i18nTestModule.ADDITION','Addition'); _t('i18nTestModule.ADDITION','Addition');
parent::__construct();
} }
} }

View File

@ -30,6 +30,10 @@ class i18nTextCollectorTest extends SapphireTest {
$_CLASS_MANIFEST['i18nTestModule'] = $this->alternateBasePath . '/i18ntestmodule/code/i18nTestModule.php'; $_CLASS_MANIFEST['i18nTestModule'] = $this->alternateBasePath . '/i18ntestmodule/code/i18nTestModule.php';
$_CLASS_MANIFEST['i18nTestModule_Addition'] = $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; global $_TEMPLATE_MANIFEST;
$_TEMPLATE_MANIFEST['i18nTestModule.ss'] = array( $_TEMPLATE_MANIFEST['i18nTestModule.ss'] = array(
'main' => $this->alternateBasePath . '/i18ntestmodule/templates/i18nTestModule.ss', 'main' => $this->alternateBasePath . '/i18ntestmodule/templates/i18nTestModule.ss',