public function PHPUnit_Util_Configuration::getListenerConfiguration in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/phpunit/phpunit/src/Util/Configuration.php \PHPUnit_Util_Configuration::getListenerConfiguration()
Returns the configuration for listeners.
@since Method available since Release 3.4.0
Return value
array
File
- vendor/
phpunit/ phpunit/ src/ Util/ Configuration.php, line 312
Class
- PHPUnit_Util_Configuration
- Wrapper for the PHPUnit XML configuration file.
Code
public function getListenerConfiguration() {
$result = array();
foreach ($this->xpath
->query('listeners/listener') as $listener) {
$class = (string) $listener
->getAttribute('class');
$file = '';
$arguments = array();
if ($listener
->getAttribute('file')) {
$file = $this
->toAbsolutePath((string) $listener
->getAttribute('file'), true);
}
foreach ($listener->childNodes as $node) {
if ($node instanceof DOMElement && $node->tagName == 'arguments') {
foreach ($node->childNodes as $argument) {
if ($argument instanceof DOMElement) {
if ($argument->tagName == 'file' || $argument->tagName == 'directory') {
$arguments[] = $this
->toAbsolutePath((string) $argument->textContent);
}
else {
$arguments[] = PHPUnit_Util_XML::xmlToVariable($argument);
}
}
}
}
}
$result[] = array(
'class' => $class,
'file' => $file,
'arguments' => $arguments,
);
}
return $result;
}