Ticket #151: phing230_ext-phpunit-group.patch

File phing230_ext-phpunit-group.patch, 1.4 kB (added by dirk.thomas@4wdmedia, 1 year ago)

patch to add group attribute to phpunit-task

  • PHPUnitTask.php

    old new  
    4545        private $printsummary = false; 
    4646        private $testfailed = false; 
    4747        private $codecoverage = false; 
     48        private $group = false; 
    4849 
    4950        /** 
    5051         * Initialize Task. 
     
    167168                $this->codecoverage = $codecoverage; 
    168169        } 
    169170 
     171        function setGroup($group) 
     172        { 
     173                $this->group = $group; 
     174        } 
     175 
    170176        /** 
    171177         * Add a new formatter to all tests of this task. 
    172178         * 
     
    262268         */ 
    263269        private function execute($suite) 
    264270        { 
    265                 $runner = new PHPUnitTestRunner($suite, $this->project); 
     271                $runner = new PHPUnitTestRunner($suite, $this->project, $this->group); 
    266272                 
    267273                $runner->setCodecoverage($this->codecoverage); 
    268274 
  • PHPUnitTestRunner.php

    old new  
    4646         
    4747        private $project = NULL; 
    4848 
    49         function __construct($suite, Project $project) 
     49        private $group = false; 
     50 
     51        function __construct($suite, Project $project, $group = false) 
    5052        { 
    5153                $this->suite = $suite; 
    5254                $this->project = $project; 
     55                $this->group = $group; 
    5356                $this->retCode = self::SUCCESS; 
    5457        } 
    5558         
     
    8891                        $res->addListener($formatter); 
    8992                } 
    9093 
    91                 $this->suite->run($res); 
     94                $this->suite->run($res, false, $this->group); 
    9295                 
    9396                if ($this->codecoverage) 
    9497                {