WordPress.org

Make WordPress Core

Changeset 339 in tests


Ignore:
Timestamp:
03/22/2011 09:13:07 AM (7 years ago)
Author:
westi
Message:

Add support for multiple -t command line options
Display more info about tests skipped due to trac ticket still being open
Props dd32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testlib/base.php

    r335 r339  
    422422    function knownWPBug($ticket_id) {
    423423        if (!TEST_FORCE_KNOWN_BUGS && (TEST_SKIP_KNOWN_BUGS || !$this->isTracTicketClosed('http://trac.wordpress.org', $ticket_id))) {
    424             $this->markTestSkipped();
     424            $this->markTestSkipped( sprintf('WordPress Ticket #%d is not fixed', $ticket_id) );
    425425        }
    426426    }
     
    431431    function knownMUBug($ticket_id) {
    432432        if (!TEST_FORCE_KNOWN_BUGS && (TEST_SKIP_KNOWN_BUGS || !$this->isTracTicketClosed('http://trac.mu.wordpress.org', $ticket_id))) {
    433             $this->markTestSkipped();
     433            $this->markTestSkipped( sprintf('WordPress MU Ticket #%d is not fixed', $ticket_id) );
    434434        }
    435435    }
     
    440440    function knownPluginBug($ticket_id) {
    441441        if (!TEST_FORCE_KNOWN_BUGS && (TEST_SKIP_KNOWN_BUGS || !$this->isTracTicketClosed('http://dev.wp-plugins.org', $ticket_id))) {
    442             $this->markTestSkipped();
     442            $this->markTestSkipped( sprintf('WordPress Plugin Ticket #%d is not fixed', $ticket_id) );
    443443        }
    444444    }
     
    528528}
    529529
    530 function wptest_run_tests($classes, $classname='') {
     530function wptest_run_tests($classes, $classnames = '') {
    531531    $suite = new PHPUnit_Framework_TestSuite();
    532     foreach ($classes as $testcase)
    533         if (!$classname or strtolower($testcase) == strtolower($classname)) {
     532
     533    if ( !is_array($classnames) )
     534        $classnames = array($classnames);
     535
     536    $classnames = array_map('strtolower', $classnames);
     537
     538    foreach ( $classes as $testcase ) {
     539        if ( empty($classnames) || in_array(strtolower($testcase), $classnames) ) {
    534540            $suite->addTestSuite($testcase);
    535541        }
     542    }
    536543
    537544    #return PHPUnit::run($suite);
Note: See TracChangeset for help on using the changeset viewer.