Permalink
Browse files

Merge pull request #594 from austinhyde/listener-arguments-fix

  • Loading branch information...
2 parents 784fa73 + dd560a3 commit d4efc6bd352d7e8e5e1bcfbab5a494f9317a3c51 @sebastianbergmann committed Jun 22, 2012
Showing with 14 additions and 4 deletions.
  1. +4 −3 PHPUnit/Util/Configuration.php
  2. +9 −1 Tests/Util/ConfigurationTest.php
  3. +1 −0 Tests/_files/configuration.xml
@@ -344,9 +344,9 @@ public function getListenerConfiguration()
);
}
- if ($listener->childNodes->item(1) instanceof DOMElement &&
- $listener->childNodes->item(1)->tagName == 'arguments') {
- foreach ($listener->childNodes->item(1)->childNodes as $argument) {
+ 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') {
@@ -356,6 +356,7 @@ public function getListenerConfiguration()
}
}
}
+ }
}
$result[] = array(
@@ -205,7 +205,15 @@ public function testListenerConfigurationIsReadCorrectly()
'class' => 'IncludePathListener',
'file' => __FILE__,
'arguments' => array()
- )
+ ),
+ array(
+ 'class' => 'CompactArgumentsListener',
+ 'file' => '/CompactArgumentsListener.php',
+ 'arguments' =>
+ array(
+ 0 => 42
+ ),
+ ),
),
$this->configuration->getListenerConfiguration()
);
@@ -71,6 +71,7 @@
</arguments>
</listener>
<listener class="IncludePathListener" file="ConfigurationTest.php" />
+ <listener class="CompactArgumentsListener" file="/CompactArgumentsListener.php"><arguments><integer>42</integer></arguments></listener>
</listeners>
<logging>

0 comments on commit d4efc6b

Please sign in to comment.