diff options
author | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-17 17:27:27 +0200 |
---|---|---|
committer | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-17 17:27:27 +0200 |
commit | f9b8008a4ccae56009894e4052dba80752d562bc (patch) | |
tree | 453331a525fc3e09c30ca3e52d85959306fe41bc /_testing/tests/testing/inttests_plugins.test.php | |
parent | e048653b52aad13b5964e1626192ffee2211870b (diff) | |
download | rpg-f9b8008a4ccae56009894e4052dba80752d562bc.tar.gz rpg-f9b8008a4ccae56009894e4052dba80752d562bc.tar.bz2 |
BROKEN added enable/disable feature for plugins
Diffstat (limited to '_testing/tests/testing/inttests_plugins.test.php')
-rw-r--r-- | _testing/tests/testing/inttests_plugins.test.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/_testing/tests/testing/inttests_plugins.test.php b/_testing/tests/testing/inttests_plugins.test.php new file mode 100644 index 000000000..bf3775b26 --- /dev/null +++ b/_testing/tests/testing/inttests_plugins.test.php @@ -0,0 +1,49 @@ +<?php + +/** + * @group integration + */ +class InttestsPluginsTest extends DokuWikiTest { + + function testTestingPluginEnabled() { + global $EVENT_HANDLER, $plugin_controller; + + $this->assertTrue( + $plugin_controller->enable('testing'), + 'Could not enable testing plugin.' + ); + + $request = new TestRequest(); + $hookTriggered = false; + + $EVENT_HANDLER->register_hook('TESTING_PLUGIN_INSTALLED', 'AFTER', null, + function() use (&$hookTriggered) { + $hookTriggered = true; + } + ); + + $request->execute(); + + $this->assertTrue($hookTriggered, 'Testing plugin did not trigger!'); + } + + /** + * @depends testTestingPluginEnabled + */ + function testTestingPluginDisabledDefault() { + global $EVENT_HANDLER; + + $request = new TestRequest(); + $hookTriggered = false; + + $EVENT_HANDLER->register_hook('TESTING_PLUGIN_INSTALLED', 'AFTER', null, + function() use (&$hookTriggered) { + $hookTriggered = true; + } + ); + + $request->execute(); + + $this->assertFalse($hookTriggered, 'Testing plugin did trigger!'); + } +} |