Show
Ignore:
Timestamp:
05/15/2007 08:54:57 PM (20 months ago)
Author:
wei
Message:

update phing simpletest task

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php

    r1186 r1953  
    2222require_once 'phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php'; 
    2323require_once 'phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php'; 
    24 require_once 'phing/tasks/ext/phpunit2/FormatterElement.php'; 
     24require_once 'phing/tasks/ext/simpletest/SimpleTestXmlResultFormatter.php'; 
    2525 
    2626/** 
     
    3333 * @since 2.2.0 
    3434 */ 
    35 class SimpleTestFormatterElement extends FormatterElement 
     35class SimpleTestFormatterElement 
    3636{ 
     37        protected $formatter = NULL; 
     38 
     39        protected $type = ""; 
     40 
     41        protected $useFile = true; 
     42 
     43        protected $toDir = "."; 
     44 
     45        protected $outfile = ""; 
     46 
    3747        function setType($type) 
    3848        { 
     
    4151                if ($this->type == "xml") 
    4252                { 
    43                         $destFile = new PhingFile($this->toDir, 'testsuites.xml'); 
    44                         //$this->formatter = new SimpleTestXmlResultFormatter(); 
     53                        //$destFile = new PhingFile($this->toDir, 'testsuites.xml'); 
     54                        $this->formatter = new SimpleTestXmlResultFormatter(); 
    4555                } 
    4656                else 
     
    5969                } 
    6070        } 
     71 
     72        function setClassName($className) 
     73        { 
     74                $classNameNoDot = Phing::import($className); 
     75 
     76                $this->formatter = new $classNameNoDot(); 
     77        } 
     78 
     79        function setUseFile($useFile) 
     80        { 
     81                $this->useFile = $useFile; 
     82        } 
     83 
     84        function getUseFile() 
     85        { 
     86                return $this->useFile; 
     87        } 
     88 
     89        function setToDir($toDir) 
     90        { 
     91                $this->toDir = $toDir; 
     92        } 
     93 
     94        function getToDir() 
     95        { 
     96                return $this->toDir; 
     97        } 
     98 
     99        function setOutfile($outfile) 
     100        { 
     101                $this->outfile = $outfile; 
     102        } 
     103 
     104        function getOutfile() 
     105        { 
     106                if ($this->outfile) 
     107                { 
     108                        return $this->outfile; 
     109                } 
     110                else 
     111                { 
     112                        return $this->formatter->getPreferredOutfile() . $this->getExtension(); 
     113                } 
     114        } 
     115 
     116        function getExtension() 
     117        { 
     118                return $this->formatter->getExtension(); 
     119        } 
     120 
     121        function getFormatter() 
     122        { 
     123                return $this->formatter; 
     124        } 
    61125} 
    62126?>