public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // copy CSS test file to test directory
     TestUtils::rcopy(DOKU_INC . '_test/data/tmp', DOKU_INC . 'lib/plugins/odt/_test/dw_css_with_wrap.css');
     TestUtils::rcopy(DOKU_INC . '_test/data/tmp', DOKU_INC . 'lib/plugins/odt/_test/dw_css_without_extra_wrap.css');
 }
Exemplo n.º 2
0
 /**
  * Setup the testing environment
  *
  * @author Johnathan Pulos <*****@*****.**>
  */
 public function setUp()
 {
     parent::setUp();
     $this->plugin = new action_plugin_revhistory();
     $this->plugin->testing = true;
     $this->eventHandler = $this->getMockBuilder('Doku_Event')->setConstructorArgs(array('ACTION_ACT_PREPROCESS', 'revhistory'))->getMock();
     TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/data/');
 }
Exemplo n.º 3
0
 /**
  * Setup the data directory
  *
  * This is ran before each test class
  */
 public static function setUpBeforeClass()
 {
     // just to be safe not to delete something undefined later
     if (!defined('TMP_DIR')) {
         die('no temporary directory');
     }
     if (!defined('DOKU_TMP_DATA')) {
         die('no temporary data directory');
     }
     // remove any leftovers from the last run
     if (is_dir(DOKU_TMP_DATA)) {
         TestUtils::rdelete(DOKU_TMP_DATA);
     }
     // populate default dirs
     TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/../data/');
 }
Exemplo n.º 4
0
 /**
  * helper for recursive copy()
  *
  * @static
  * @param $destdir string
  * @param $source string
  */
 public static function rcopy($destdir, $source)
 {
     if (!is_dir($source)) {
         copy($source, $destdir . '/' . basename($source));
     } else {
         $newdestdir = $destdir . '/' . basename($source);
         if (!is_dir($newdestdir)) {
             mkdir($newdestdir);
         }
         $dh = dir($source);
         while (false !== ($entry = $dh->read())) {
             if ($entry == '.' || $entry == '..') {
                 continue;
             }
             TestUtils::rcopy($newdestdir, $source . '/' . $entry);
         }
         $dh->close();
     }
 }
Exemplo n.º 5
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // copy the test data
     TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/data/');
 }
Exemplo n.º 6
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // copy our own config files to the test directory
     TestUtils::rcopy(dirname(DOKU_CONF), dirname(__FILE__) . '/conf');
 }
Exemplo n.º 7
0
if (php_sapi_name() == 'cli') {
    $_SERVER = array_merge($default_server_vars, $_SERVER);
}
// create temp directories
mkdir(TMP_DIR);
// cleanup dir after exit
if (getenv('PRESERVE_TMP') != 'true') {
    register_shutdown_function(function () {
        TestUtils::rdelete(TMP_DIR);
    });
} else {
    echo ">>>> Preserving temporary directory: " . TMP_DIR . "\n";
}
// populate default dirs
TestUtils::rcopy(TMP_DIR, DOKU_INC . '/conf');
TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/conf');
mkdir(DOKU_TMP_DATA);
foreach (array('attic', 'cache', 'index', 'locks', 'media', 'media_attic', 'media_meta', 'meta', 'pages', 'tmp') as $dir) {
    mkdir(DOKU_TMP_DATA . '/' . $dir);
}
// disable all non-default plugins by default
$dh = dir(DOKU_INC . 'lib/plugins/');
while (false !== ($entry = $dh->read())) {
    if ($entry == '.' || $entry == '..') {
        continue;
    }
    if (!is_dir(DOKU_INC . 'lib/plugins/' . $entry)) {
        continue;
    }
    if (!in_array($entry, $default_plugins)) {
        // disable this plugin
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // copy CSS test files to test directory
     TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/data/');
 }