Changeset 2f5dd85


Ignore:
Timestamp:
01/20/12 21:56:12 (4 months ago)
Author:
Bryan Davis <bpd@…>
Branches:
master
Children:
4870cff
Parents:
f3e60a4
git-author:
Bryan Davis <bpd@…> (01/20/12 21:56:12)
git-committer:
Bryan Davis <bpd@…> (01/20/12 21:56:12)
Message:

Allow PHPUnit_Framework_TestSuite subclasses.

PHPUnit expects PHPUnit_Framework_TestSuite subclasses to be added to an
existing test suite as real objects rather than as ReflectionClass
wrappers. This small change BatchTest checks the type of each test
before passing it on to PHPUnit and skips the reflection wrapper if the
class is of the correct type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/phing/tasks/ext/phpunit/BatchTest.php

    r61a14c5 r2f5dd85  
    200200        foreach ($this->elements() as $test) 
    201201        { 
    202             $testClass = new ReflectionClass($test); 
     202            $testClass = new $test(); 
     203            if (!($testClass instanceof PHPUnit_Framework_TestSuite)) 
     204            { 
     205              $testClass = new ReflectionClass($test); 
     206            } 
    203207             
    204208            $suite->addTestSuite($testClass); 
     
    215219    { 
    216220        foreach ($this->elements() as $element) { 
    217             $suite->addTestSuite(new ReflectionClass($element)); 
     221            $testClass = new $element(); 
     222            if (!($testClass instanceof PHPUnit_Framework_TestSuite)) 
     223            { 
     224                $testClass = new ReflectionClass($element); 
     225            } 
     226            $suite->addTestSuite($testClass); 
    218227        } 
    219228    } 
Note: See TracChangeset for help on using the changeset viewer.