Skip to content

Commit

Permalink
MINOR Adding SiteConfig as Translatable dependency in SiteTreeTest an…
Browse files Browse the repository at this point in the history
…d TranslatableTest (from r98228)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102634 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Apr 13, 2010
1 parent d7f2925 commit b73d75f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/SiteTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ static function set_up_once() {
Translatable::set_default_locale("en_US");

// refresh the decorated statics - different fields in $db with Translatable enabled
if(self::$origTranslatableSettings['has_extension'])
if(self::$origTranslatableSettings['has_extension']) {
Object::remove_extension('SiteTree', 'Translatable');
Object::remove_extension('SiteConfig', 'Translatable');
}

// recreate database with new settings
$dbname = self::create_temp_db();
Expand All @@ -34,8 +36,11 @@ static function set_up_once() {
}

static function tear_down_once() {
if(self::$origTranslatableSettings['has_extension'])
if(self::$origTranslatableSettings['has_extension']) {
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');
}


Translatable::set_default_locale(self::$origTranslatableSettings['default_locale']);
Translatable::set_current_locale(self::$origTranslatableSettings['default_locale']);
Expand Down
1 change: 1 addition & 0 deletions tests/model/TranslatableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TranslatableTest extends FunctionalTest {

protected $requiredExtensions = array(
'SiteTree' => array('Translatable'),
'SiteConfig' => array('Translatable'),
'TranslatableTest_DataObject' => array('Translatable'),
);

Expand Down

0 comments on commit b73d75f

Please sign in to comment.