3 * This file is part of the PHP_CodeCoverage package.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * @since Class available since Release 2.0.0
14 class PHP_CodeCoverage_Report_XML_Project extends PHP_CodeCoverage_Report_XML_Node
16 public function __construct($name)
19 $this->setProjectName($name);
22 private function init()
24 $dom = new DOMDocument;
25 $dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="http://schema.phpunit.de/coverage/1.0"><project/></phpunit>');
27 $this->setContextNode(
28 $dom->getElementsByTagNameNS(
29 'http://schema.phpunit.de/coverage/1.0',
35 private function setProjectName($name)
37 $this->getContextNode()->setAttribute('name', $name);
40 public function getTests()
42 $testsNode = $this->getContextNode()->getElementsByTagNameNS(
43 'http://schema.phpunit.de/coverage/1.0',
48 $testsNode = $this->getContextNode()->appendChild(
49 $this->getDom()->createElementNS(
50 'http://schema.phpunit.de/coverage/1.0',
56 return new PHP_CodeCoverage_Report_XML_Tests($testsNode);
59 public function asDom()
61 return $this->getDom();