summaryrefslogtreecommitdiff
path: root/_testing/core/DokuWikiTest.php
diff options
context:
space:
mode:
authorTobias Sarnowski <sarnowski@cosmocode.de>2012-04-18 09:28:04 +0200
committerTobias Sarnowski <sarnowski@cosmocode.de>2012-04-18 09:28:04 +0200
commit32f9c1842012717be9d1e92107ee4687c535702e (patch)
tree63c77573b7d883e6042e263eb0a1877624fa4ba8 /_testing/core/DokuWikiTest.php
parentf9b8008a4ccae56009894e4052dba80752d562bc (diff)
downloadrpg-32f9c1842012717be9d1e92107ee4687c535702e.tar.gz
rpg-32f9c1842012717be9d1e92107ee4687c535702e.tar.bz2
fixed broken plugin system
Diffstat (limited to '_testing/core/DokuWikiTest.php')
-rw-r--r--_testing/core/DokuWikiTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/_testing/core/DokuWikiTest.php b/_testing/core/DokuWikiTest.php
index 2517e25e3..f464aab8e 100644
--- a/_testing/core/DokuWikiTest.php
+++ b/_testing/core/DokuWikiTest.php
@@ -3,6 +3,12 @@
* Helper class to provide basic functionality for tests
*/
abstract class DokuWikiTest extends PHPUnit_Framework_TestCase {
+
+ // tests can override this
+ protected $pluginsEnabled = array();
+ // tests can override this
+ protected $pluginsDisabled = array();
+
/**
* Reset the DokuWiki environment before each test run
*
@@ -51,6 +57,21 @@ abstract class DokuWikiTest extends PHPUnit_Framework_TestCase {
}
}
+ // disable and enable configured plugins
+ foreach ($this->pluginsDisabled as $plugin) {
+ if (!$plugin_controller->disable($plugin)) {
+ throw new Exception('Could not disable plugin "'.$plugin.'"!');
+ }
+ }
+ foreach ($this->pluginsEnabled as $plugin) {
+ /* enable() returns false but works...
+ if (!$plugin_controller->enable($plugin)) {
+ throw new Exception('Could not enable plugin "'.$plugin.'"!');
+ }
+ */
+ $plugin_controller->enable($plugin);
+ }
+
// reset event handler
global $EVENT_HANDLER;
$EVENT_HANDLER = new Doku_Event_Handler();