diff options
Diffstat (limited to '_testing/inttests')
-rw-r--r-- | _testing/inttests/basic.test.php | 14 | ||||
-rw-r--r-- | _testing/inttests/hooks.test.php | 17 |
2 files changed, 31 insertions, 0 deletions
diff --git a/_testing/inttests/basic.test.php b/_testing/inttests/basic.test.php new file mode 100644 index 000000000..56cef965f --- /dev/null +++ b/_testing/inttests/basic.test.php @@ -0,0 +1,14 @@ +<?php + +class BasicTest extends PHPUnit_Framework_TestCase { + function testSimpleRun() { + $request = new TestRequest(); + + $response = $request->execute(); + + $this->assertTrue( + strpos($response->getContent(), 'DokuWiki') >= 0, + 'DokuWiki was not a word in the output' + ); + } +} diff --git a/_testing/inttests/hooks.test.php b/_testing/inttests/hooks.test.php new file mode 100644 index 000000000..6a31d5dc2 --- /dev/null +++ b/_testing/inttests/hooks.test.php @@ -0,0 +1,17 @@ +<?php + +class HooksTest extends PHPUnit_Framework_TestCase { + + function testHookTriggering() { + $request = new TestRequest(); + + $hookTriggered = false; + $request->hook('TPL_CONTENT_DISPLAY', 'AFTER', function() use (&$hookTriggered) { + $hookTriggered = true; + }); + + $request->execute(); + + $this->assertTrue($hookTriggered, 'Hook was not triggered as expected!'); + } +} |