WordPress.org

Make WordPress Core

Changeset 288 in tests


Ignore:
Timestamp:
01/21/2010 09:44:35 PM (8 years ago)
Author:
westi
Message:

Introduce a getopt compatibility function for platforms / php versions that don't have it.
Ensure that we use the correct path seperator on windows.
Fixes WP#11867 props hakre.

Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • wp-test.php

    r265 r288  
    11<?php
     2/**
     3 * wp-test.php
     4 *
     5 * WordPress Testrunner
     6 *
     7 * Example:
     8 *
     9 * # php wp-test.php -l
     10 *
     11 */
    212
    3 $opts = getopt('v:t:r:sfln');
     13// parse options
     14$options = 'v:t:r:sfln';
     15if (is_callable('getopt')) {
     16    $opts = getopt($options);
     17} else {   
     18    include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
     19    $opts = getoptParser::getopt($options);
     20}
    421
    522define('DIR_TESTROOT', realpath(dirname(__FILE__)));
     
    8299
    83100// needed for jacob's tests
    84 ini_set('include_path', ini_get('include_path') . ':'.ABSPATH.'/wp-includes');
     101ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . ABSPATH . '/wp-includes');
    85102define('PHPUnit_MAIN_METHOD', false);
    86103$original_wpdb = $GLOBALS['wpdb'];
Note: See TracChangeset for help on using the changeset viewer.