function Loader::load
Same name in this branch
- 11.1.x vendor/phpunit/phpunit/src/Util/Xml/Loader.php \PHPUnit\Util\Xml\Loader::load()
Throws
File
-
vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ Loader.php, line 87
Class
- Loader
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\TextUI\XmlConfigurationCode
public function load(string $filename) : LoadedFromFileConfiguration {
try {
$document = (new XmlLoader())->loadFile($filename);
} catch (XmlException $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
$xpath = new DOMXPath($document);
try {
$xsdFilename = (new SchemaFinder())->find(Version::series());
} catch (CannotFindSchemaException $e) {
throw new Exception($e->getMessage(), $e->getCode(), $e);
}
$configurationFileRealpath = realpath($filename);
return new LoadedFromFileConfiguration($configurationFileRealpath, (new Validator())->validate($document, $xsdFilename), $this->extensions($xpath), $this->source($configurationFileRealpath, $xpath), $this->codeCoverage($configurationFileRealpath, $xpath), $this->groups($xpath), $this->logging($configurationFileRealpath, $xpath), $this->php($configurationFileRealpath, $xpath), $this->phpunit($configurationFileRealpath, $document), $this->testSuite($configurationFileRealpath, $xpath));
}