Permalink
Browse files

- change back to being db test to make sure db is setup, and also fix…

… case where ezoe is not activated

git-svn-id: http://svn.projects.ez.no/ezoe/trunk@260 0f997322-f765-4293-a636-cd5f354860a4
  • Loading branch information...
1 parent d73c3f7 commit e8b532147e9dff895644d7e6ae8311d19e7be666 @andrerom andrerom committed Jul 13, 2010
Showing with 36 additions and 2 deletions.
  1. +6 −1 tests/ezoexmltext_regression.php
  2. +30 −1 tests/suite.php
@@ -7,14 +7,19 @@
* @package tests
*/
-class eZOEXMLTextRegression extends ezpTestCase
+class eZOEXMLTextRegression extends ezpDatabaseTestCase
{
public function __construct()
{
parent::__construct();
$this->setName( "eZXMLText Datatype OE Regression Tests" );
}
+ public function setUp()
+ {
+ parent::setUp();
+ }
+
/**
* Test for issue #16605: Online Editor adds a lot of Non Breaking spaces (nbsp)
*
View
@@ -7,19 +7,48 @@
* @package tests
*/
-class eZOeTestSuite extends ezpTestSuite
+class eZOeTestSuite extends ezpDatabaseTestSuite
{
public function __construct()
{
parent::__construct();
$this->setName( "eZ Online Editor Test Suite" );
$this->addTestSuite( 'eZOEXMLTextRegression' );
+ $this->ezoeIsLoaded = null;
}
public static function suite()
{
return new self();
}
+
+ public function setUp()
+ {
+ // make sure ezoe settings are read
+ $ini = eZINI::instance();
+ $activeExtensions = $ini->variable( 'ExtensionSettings', 'ActiveExtensions' );
+ if ( !in_array( 'ezoe', $activeExtensions, true ) )
+ {
+ $this->ezoeIsLoaded = true;
+ $activeExtensions[] = 'ezoe';
+ $ini->setVariable( 'ExtensionSettings', 'ActiveExtensions', $activeExtensions );
+ $extensionDirectory = eZExtension::baseDirectory();
+ $ini->prependOverrideDir( $extensionDirectory . '/ezoe/settings', true, 'extension:ezoe', 'extension' );
+ }
+ parent::setUp();
+ }
+
+ public function tearDown()
+ {
+ if ( $this->ezoeIsLoaded )
+ {
+ $ini = eZINI::instance();
+ $activeExtensions = $ini->variable( 'ExtensionSettings', 'ActiveExtensions' );
+ $ini->setVariable( 'ExtensionSettings', 'ActiveExtensions', array_diff( $activeExtensions, array('ezoe') ) );
+ // @todo: remove ezoe ini override when eZINI has api for that
+ }
+ parent::tearDown();
+ }
}
?>

0 comments on commit e8b5321

Please sign in to comment.