Skip to content
Snippets Groups Projects
  1. May 06, 2010
  2. May 05, 2010
  3. May 04, 2010
  4. Apr 30, 2010
  5. Apr 29, 2010
  6. Apr 28, 2010
  7. Apr 26, 2010
  8. Apr 18, 2010
  9. Apr 15, 2010
  10. Apr 12, 2010
  11. Apr 11, 2010
  12. Apr 10, 2010
  13. Apr 09, 2010
  14. Apr 08, 2010
  15. Apr 04, 2010
  16. Apr 03, 2010
  17. Apr 02, 2010
  18. Mar 31, 2010
  19. Mar 30, 2010
    • Michael Klier's avatar
      added support for plugin unittests · 08d7babf
      Michael Klier authored
      	This patch adds support to include plugin tests in the
      	DokuWiki testsuite. Plugin tests are located in a dedicated
      	directory _test/within a plugin directory. The naming
      	convention of the test files follows the one used in
      	DokuWikis testsuite.
      
      		<plugin>/_test/*.test.php 	-> single test
      		<plugin>/_test/*.group.php  -> group test
      
      	The plugin tests are accessible via the web interface
      	of the test suite and via the cli interface. It is recommend
      	to bundle plugin test in a plugin group test. The webinterface
      	also allows to run all plugin tests at once.
      
      	Test files must include:
      
      		<dokuwiki>/_test/lib/unittest.php
      
      	Example Test:
      
      	require_once(DOKU_INC.'_test/lib/unittest.php');
      	class plugin_test extends Doku_UnitTestCase {
      		function test() {
      			$this->assertEqual(1,1);
      		}
      	}
      
      	Example Group Test:
      
      	require_once(DOKU_INC.'_test/lib/unittest.php');
      	class plugin_group_test extends Doku_GroupTest {
      		function group_test() {
      			$dir = dirname(__FILE__).'/';
      			$this->GroupTest('plugin_grouptest');
      			$this->addTestFile($dir . 'plugin.test1.php');
      			$this->addTestFile($dir . 'plugin.test2.php');
      			$this->addTestFile($dir . 'plugin.test3.php');
      		}
      	}
      
      	At the moment unittest.php contains only two
      	meta classes so plugins tests don't have to inherit
      	from the simpletest classes.
      
      	This patch should be treated as intermediate step to
      	allow for plugin tests. The testsuite wasn't designed
      	to include plugin tests. It should probably be refactored
      	at a later point.
      08d7babf
Loading