Skip to content

Commit

Permalink
Merge pull request #594 from austinhyde/listener-arguments-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 22, 2012
2 parents 784fa73 + dd560a3 commit d4efc6b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 4 additions & 3 deletions PHPUnit/Util/Configuration.php
Expand Up @@ -344,9 +344,9 @@ public function getListenerConfiguration()
); );
} }


if ($listener->childNodes->item(1) instanceof DOMElement && foreach ($listener->childNodes as $node) {
$listener->childNodes->item(1)->tagName == 'arguments') { if ($node instanceof DOMElement && $node->tagName == 'arguments') {
foreach ($listener->childNodes->item(1)->childNodes as $argument) { foreach ($node->childNodes as $argument) {
if ($argument instanceof DOMElement) { if ($argument instanceof DOMElement) {
if ($argument->tagName == 'file' || if ($argument->tagName == 'file' ||
$argument->tagName == 'directory') { $argument->tagName == 'directory') {
Expand All @@ -356,6 +356,7 @@ public function getListenerConfiguration()
} }
} }
} }
}
} }


$result[] = array( $result[] = array(
Expand Down
10 changes: 9 additions & 1 deletion Tests/Util/ConfigurationTest.php
Expand Up @@ -205,7 +205,15 @@ public function testListenerConfigurationIsReadCorrectly()
'class' => 'IncludePathListener', 'class' => 'IncludePathListener',
'file' => __FILE__, 'file' => __FILE__,
'arguments' => array() 'arguments' => array()
) ),
array(
'class' => 'CompactArgumentsListener',
'file' => '/CompactArgumentsListener.php',
'arguments' =>
array(
0 => 42
),
),
), ),
$this->configuration->getListenerConfiguration() $this->configuration->getListenerConfiguration()
); );
Expand Down
1 change: 1 addition & 0 deletions Tests/_files/configuration.xml
Expand Up @@ -71,6 +71,7 @@
</arguments> </arguments>
</listener> </listener>
<listener class="IncludePathListener" file="ConfigurationTest.php" /> <listener class="IncludePathListener" file="ConfigurationTest.php" />
<listener class="CompactArgumentsListener" file="/CompactArgumentsListener.php"><arguments><integer>42</integer></arguments></listener>
</listeners> </listeners>


<logging> <logging>
Expand Down

0 comments on commit d4efc6b

Please sign in to comment.