summaryrefslogtreecommitdiff
path: root/_testing/core/DokuWikiTest.php
diff options
context:
space:
mode:
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();