WordPress.org

Make WordPress Core

Changeset 341 in tests


Ignore:
Timestamp:
03/22/11 10:51:14 (3 years ago)
Author:
dd32
Message:
More flexible support for multi-test runs. -t Testcase1 -t Testcase2
-t TestCase1,TestCast2 -t "TestCase1 TestCase2" -t "TestCase1, TestCase2"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testlib/base.php

    r340 r341  
    531531    $suite = new PHPUnit_Framework_TestSuite(); 
    532532 
    533     if ( ! is_array($classnames) )  
    534         $classnames = array($classnames); 
     533    if ( ! is_array($classnames) ) // For strings, Accept a comma separated list, or a space separated list. 
     534        $classnames = preg_split('![,\s]+!', $classnames); 
    535535 
    536536    $classnames = array_map('strtolower', $classnames); 
     537    $classnames = array_filter($classnames); //strip out any empty items 
    537538 
    538539    foreach ( $classes as $testcase ) { 
    539         if ( empty($classnames) || in_array(strtolower($testcase), $classnames) ) { 
     540        if ( empty($classnames) || in_array( strtolower($testcase), $classnames ) ) { 
    540541            $suite->addTestSuite($testcase); 
    541542        } 
Note: See TracChangeset for help on using the changeset viewer.