Changeset 62

Show
Ignore:
Timestamp:
05/04/06 11:36:36 (2 years ago)
Author:
mrook
Message:

Fix testcases with no @package tag not showing up in the test reports

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/classes/phing/tasks/ext/phpunit2/PHPUnit2ReportTask.php

    r59 r62  
    146146                } 
    147147        } 
     148         
     149        /** 
     150         * Fixes 'testsuite' elements with no package attribute, adds 
     151         * package="default" to those elements. 
     152         */ 
     153        function fixPackages(DOMDocument $document) 
     154        { 
     155                $testsuites = $document->getElementsByTagName('testsuite'); 
     156                 
     157                foreach ($testsuites as $testsuite) 
     158                { 
     159                        if (!$testsuite->hasAttribute('package')) 
     160                        { 
     161                                $testsuite->setAttribute('package', 'default'); 
     162                        } 
     163                } 
     164        } 
    148165 
    149166        /** 
     
    157174                $testSuitesDoc->load($this->inFile); 
    158175                 
     176                $this->fixPackages($testSuitesDoc); 
     177                 
    159178                $this->transform($testSuitesDoc); 
    160179        }