Skip to content

Commit

Permalink
added missing testing plugin with tests to test tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Sarnowski committed Apr 18, 2012
1 parent bc82a8a commit f693efb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
@@ -0,0 +1,32 @@
<?php

/**
* @group integration
*/
class TestingDummyPluginIntegrationTest extends DokuWikiTest {

function setUp() {
$this->pluginsEnabled = array(
'testing'
);

parent::setUp();
}

function testTestingPluginEnabled() {
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->assertTrue($hookTriggered, 'Testing plugin did not trigger!');
}
}
9 changes: 9 additions & 0 deletions lib/plugins/testing/_testing/dummy_plugin_test.test.php
@@ -0,0 +1,9 @@
<?php

class TestingDummyPluginTest extends DokuWikiTest {

function testNothing() {
$this->assertTrue(true, 'wow, you really fucked up');
}

}
13 changes: 13 additions & 0 deletions lib/plugins/testing/action.php
@@ -0,0 +1,13 @@
<?php

class action_plugin_testing extends DokuWiki_Action_Plugin {
function register(&$controller) {
$controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'dokuwikiStarted');
}

function dokuwikiStarted() {
$param = array();
trigger_event('TESTING_PLUGIN_INSTALLED', $param);
msg('hohoho');
}
}
5 changes: 5 additions & 0 deletions lib/plugins/testing/plugin.testing.txt
@@ -0,0 +1,5 @@
author Tobias Sarnowski
email tobias@trustedco.de
date 2012-04-17
name Testing Plugin
desc Used to test the test framework.

0 comments on commit f693efb

Please sign in to comment.