Skip to content

Commit

Permalink
- Merge [5037].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jul 30, 2009
1 parent 08587e8 commit 8c37fcb
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 31 deletions.
4 changes: 2 additions & 2 deletions PHPUnit/Tests/TextUI/dataprovider-log-xml-isolation.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--TEST--
phpunit --process-isolation --log-xml php://stdout DataProviderTest ../_files/DataProviderTest.php
phpunit --process-isolation --log-junit php://stdout DataProviderTest ../_files/DataProviderTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--process-isolation';
$_SERVER['argv'][3] = '--log-xml';
$_SERVER['argv'][3] = '--log-junit';
$_SERVER['argv'][4] = 'php://stdout';
$_SERVER['argv'][5] = 'DataProviderTest';
$_SERVER['argv'][6] = dirname(dirname(__FILE__)) . '/_files/DataProviderTest.php';
Expand Down
4 changes: 2 additions & 2 deletions PHPUnit/Tests/TextUI/dataprovider-log-xml.phpt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--TEST--
phpunit --log-xml php://stdout DataProviderTest ../_files/DataProviderTest.php
phpunit --log-junit php://stdout DataProviderTest ../_files/DataProviderTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--log-xml';
$_SERVER['argv'][2] = '--log-junit';
$_SERVER['argv'][3] = 'php://stdout';
$_SERVER['argv'][4] = 'DataProviderTest';
$_SERVER['argv'][5] = dirname(dirname(__FILE__)) . '/_files/DataProviderTest.php';
Expand Down
4 changes: 2 additions & 2 deletions PHPUnit/Tests/TextUI/help.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ PHPUnit %s by Sebastian Bergmann.
Usage: phpunit [switches] UnitTest [UnitTest.php]
phpunit [switches] <directory>

--log-json <file> Log test execution in JSON format.
--log-junit <file> Log test execution in JUnit XML format to file.
--log-tap <file> Log test execution in TAP format to file.
--log-xml <file> Log test execution in XML format to file.
--log-json <file> Log test execution in JSON format.

--coverage-html <dir> Generate code coverage report in HTML format.
--coverage-clover <file> Write code coverage data in Clover XML format.
Expand Down
4 changes: 2 additions & 2 deletions PHPUnit/Tests/TextUI/help2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ PHPUnit %s by Sebastian Bergmann.
Usage: phpunit [switches] UnitTest [UnitTest.php]
phpunit [switches] <directory>

--log-json <file> Log test execution in JSON format.
--log-junit <file> Log test execution in JUnit XML format to file.
--log-tap <file> Log test execution in TAP format to file.
--log-xml <file> Log test execution in XML format to file.
--log-json <file> Log test execution in JSON format.

--coverage-html <dir> Generate code coverage report in HTML format.
--coverage-clover <file> Write code coverage data in Clover XML format.
Expand Down
4 changes: 2 additions & 2 deletions PHPUnit/Tests/TextUI/log-xml.phpt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--TEST--
phpunit --log-xml php://stdout BankAccountTest ../../Samples/BankAccount/BankAccountTest.php
phpunit --log-junit php://stdout BankAccountTest ../../Samples/BankAccount/BankAccountTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--log-xml';
$_SERVER['argv'][2] = '--log-junit';
$_SERVER['argv'][3] = 'php://stdout';
$_SERVER['argv'][4] = 'BankAccountTest';
$_SERVER['argv'][5] = '../Samples/BankAccount/BankAccountTest.php';
Expand Down
2 changes: 1 addition & 1 deletion PHPUnit/Tests/Util/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function testGetLoggingConfiguration()
'pmd-xml' => '/tmp/pmd.xml',
'tap' => '/tmp/logfile.tap',
'logIncompleteSkipped' => FALSE,
'test-xml' => '/tmp/logfile.xml',
'junit' => '/tmp/logfile.xml',
'story-html' => '/tmp/story.html',
'story-text' => '/tmp/story.txt',
'testdox-html' => '/tmp/testdox.html',
Expand Down
2 changes: 1 addition & 1 deletion PHPUnit/Tests/_files/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<log type="plain" target="/tmp/logfile.txt"/>
<log type="pmd-xml" target="/tmp/pmd.xml" cpdMinLines="5" cpdMinMatches="70"/>
<log type="tap" target="/tmp/logfile.tap"/>
<log type="test-xml" target="/tmp/logfile.xml" logIncompleteSkipped="false"/>
<log type="junit" target="/tmp/logfile.xml" logIncompleteSkipped="false"/>
<log type="story-html" target="/tmp/story.html"/>
<log type="story-text" target="/tmp/story.txt"/>
<log type="testdox-html" target="/tmp/testdox.html"/>
Expand Down
22 changes: 15 additions & 7 deletions PHPUnit/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class PHPUnit_TextUI_Command
'loader=' => NULL,
'log-graphviz=' => NULL,
'log-json=' => NULL,
'log-junit=' => NULL,
'log-metrics=' => NULL,
'log-pmd=' => NULL,
'log-tap=' => NULL,
Expand Down Expand Up @@ -408,6 +409,18 @@ protected function handleArguments(array $argv)
}
break;

case '--log-xml': {
$this->showMessage(
'The --log-xml option is deprecated, please use --log-junit instead.',
FALSE
);
}

case '--log-junit': {
$this->arguments['junitLogfile'] = $option[1];
}
break;

case '--log-graphviz': {
$this->showMessage(
'The --log-graphviz functionality is deprecated and will be removed in the future.',
Expand All @@ -427,11 +440,6 @@ protected function handleArguments(array $argv)
}
break;

case '--log-xml': {
$this->arguments['xmlLogfile'] = $option[1];
}
break;

case '--log-pmd': {
$this->showMessage(
'The --log-pmd functionality is deprecated and will be removed in the future.',
Expand Down Expand Up @@ -879,9 +887,9 @@ protected function showHelp()
Usage: phpunit [switches] UnitTest [UnitTest.php]
phpunit [switches] <directory>

--log-json <file> Log test execution in JSON format.
--log-junit <file> Log test execution in JUnit XML format to file.
--log-tap <file> Log test execution in TAP format to file.
--log-xml <file> Log test execution in XML format to file.
--log-json <file> Log test execution in JSON format.

--coverage-html <dir> Generate code coverage report in HTML format.
--coverage-clover <file> Write code coverage data in Clover XML format.
Expand Down
12 changes: 6 additions & 6 deletions PHPUnit/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
);
}

if (isset($arguments['xmlLogfile'])) {
require_once 'PHPUnit/Util/Log/XML.php';
if (isset($arguments['junitLogfile'])) {
require_once 'PHPUnit/Util/Log/JUnit.php';

$result->addListener(
new PHPUnit_Util_Log_XML(
$arguments['xmlLogfile'], $arguments['logIncompleteSkipped']
new PHPUnit_Util_Log_JUnit(
$arguments['junitLogfile'], $arguments['logIncompleteSkipped']
)
);
}
Expand Down Expand Up @@ -766,8 +766,8 @@ protected function handleConfiguration(array &$arguments)
$arguments['tapLogfile'] = $loggingConfiguration['tap'];
}

if (isset($loggingConfiguration['test-xml']) && !isset($arguments['xmlLogfile'])) {
$arguments['xmlLogfile'] = $loggingConfiguration['test-xml'];
if (isset($loggingConfiguration['junit']) && !isset($arguments['junitLogfile'])) {
$arguments['junitLogfile'] = $loggingConfiguration['junit'];

if (isset($loggingConfiguration['logIncompleteSkipped']) && !isset($arguments['logIncompleteSkipped'])) {
$arguments['logIncompleteSkipped'] = $loggingConfiguration['logIncompleteSkipped'];
Expand Down
4 changes: 2 additions & 2 deletions PHPUnit/Util/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
* <log type="plain" target="/tmp/logfile.txt"/>
* <log type="pmd-xml" target="/tmp/pmd.xml" cpdMinLines="5" cpdMinMatches="70"/>
* <log type="tap" target="/tmp/logfile.tap"/>
* <log type="test-xml" target="/tmp/logfile.xml" logIncompleteSkipped="false"/>
* <log type="junit" target="/tmp/logfile.xml" logIncompleteSkipped="false"/>
* <log type="story-html" target="/tmp/story.html"/>
* <log type="story-text" target="/tmp/story.txt"/>
* <log type="testdox-html" target="/tmp/testdox.html"/>
Expand Down Expand Up @@ -420,7 +420,7 @@ public function getLoggingConfiguration()
}
}

else if ($type == 'test-xml') {
else if ($type == 'junit') {
if ($log->hasAttribute('logIncompleteSkipped')) {
$result['logIncompleteSkipped'] = $this->getBoolean(
(string)$log->getAttribute('logIncompleteSkipped'),
Expand Down
2 changes: 1 addition & 1 deletion PHPUnit/Util/Log/XML.php → PHPUnit/Util/Log/JUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* @link http://www.phpunit.de/
* @since Class available since Release 2.1.0
*/
class PHPUnit_Util_Log_XML extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener
class PHPUnit_Util_Log_JUnit extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener
{
/**
* @var DOMDocument
Expand Down
6 changes: 3 additions & 3 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,9 @@
<file baseinstalldir="/" name="JSON.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="JUnit.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="Metrics.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
Expand All @@ -1274,9 +1277,6 @@
<file baseinstalldir="/" name="TAP.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="XML.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
</dir>
<dir name="Metrics">
<file baseinstalldir="/" name="Class.php" role="php">
Expand Down

0 comments on commit 8c37fcb

Please sign in to comment.