summaryrefslogtreecommitdiff
path: root/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php')
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php72
1 files changed, 68 insertions, 4 deletions
diff --git a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
index fab27315..82bf5776 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
@@ -21,7 +21,7 @@
require_once 'phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php';
require_once 'phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php';
-require_once 'phing/tasks/ext/phpunit2/FormatterElement.php';
+require_once 'phing/tasks/ext/simpletest/SimpleTestXmlResultFormatter.php';
/**
* Child class of "FormatterElement", overrides setType to provide other
@@ -32,16 +32,26 @@ require_once 'phing/tasks/ext/phpunit2/FormatterElement.php';
* @package phing.tasks.ext.simpletest
* @since 2.2.0
*/
-class SimpleTestFormatterElement extends FormatterElement
+class SimpleTestFormatterElement
{
+ protected $formatter = NULL;
+
+ protected $type = "";
+
+ protected $useFile = true;
+
+ protected $toDir = ".";
+
+ protected $outfile = "";
+
function setType($type)
{
$this->type = $type;
if ($this->type == "xml")
{
- $destFile = new PhingFile($this->toDir, 'testsuites.xml');
- //$this->formatter = new SimpleTestXmlResultFormatter();
+ //$destFile = new PhingFile($this->toDir, 'testsuites.xml');
+ $this->formatter = new SimpleTestXmlResultFormatter();
}
else
if ($this->type == "plain")
@@ -58,5 +68,59 @@ class SimpleTestFormatterElement extends FormatterElement
throw new BuildException("Formatter '" . $this->type . "' not implemented");
}
}
+
+ function setClassName($className)
+ {
+ $classNameNoDot = Phing::import($className);
+
+ $this->formatter = new $classNameNoDot();
+ }
+
+ function setUseFile($useFile)
+ {
+ $this->useFile = $useFile;
+ }
+
+ function getUseFile()
+ {
+ return $this->useFile;
+ }
+
+ function setToDir($toDir)
+ {
+ $this->toDir = $toDir;
+ }
+
+ function getToDir()
+ {
+ return $this->toDir;
+ }
+
+ function setOutfile($outfile)
+ {
+ $this->outfile = $outfile;
+ }
+
+ function getOutfile()
+ {
+ if ($this->outfile)
+ {
+ return $this->outfile;
+ }
+ else
+ {
+ return $this->formatter->getPreferredOutfile() . $this->getExtension();
+ }
+ }
+
+ function getExtension()
+ {
+ return $this->formatter->getExtension();
+ }
+
+ function getFormatter()
+ {
+ return $this->formatter;
+ }
}
?> \ No newline at end of file