Permalink
Browse files

- Merge [3549].

  • Loading branch information...
sebastianbergmann committed Aug 15, 2008
1 parent 691013f commit 4e930c96973c397e4772dd338dbca2680b2524ab
Showing with 71 additions and 0 deletions.
  1. +46 −0 PHPUnit/Tests/TextUI/dataset-log-xml.phpt
  2. +21 −0 PHPUnit/Tests/_files/DataSetTest.php
  3. +4 −0 package.xml
@@ -0,0 +1,46 @@
+--TEST--
+phpunit --log-xml php://stdout DataSetTest ../_files/DataSetTest.php
+--FILE--
+<?php
+$_SERVER['argv'][1] = '--log-xml';
+$_SERVER['argv'][2] = 'php://stdout';
+$_SERVER['argv'][3] = 'DataSetTest';
+$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/DataSetTest.php';
+
+require_once dirname(dirname(dirname(__FILE__))) . '/TextUI/Command.php';
+?>
+--EXPECTF--
+PHPUnit @package_version@ by Sebastian Bergmann.
+
+..F.<?xml version="1.0" encoding="UTF-8"?>
+<testsuites>
+ <testsuite name="DataSetTest" file="/usr/local/src/phpunit/release/3.3/PHPUnit/Tests/_files/DataSetTest.php" tests="4" assertions="4" failures="1" errors="0" time="%f">
+ <testsuite name="DataSetTest::testAdd" tests="4" assertions="4" failures="1" errors="0" time="%f">
+ <testcase name="testAdd with data set #0" assertions="1" time="%f"/>
+ <testcase name="testAdd with data set #1" assertions="1" time="%f"/>
+ <testcase name="testAdd with data set #2" assertions="1" time="%f">
+ <failure type="PHPUnit_Framework_ExpectationFailedException"><![CDATA[testAdd(DataSetTest) with data set #2 (1, 1, 3)
+Failed asserting that <integer:2> matches expected value <integer:3>.
+
+%s:%i
+%s:%i
+]]></failure>
+ </testcase>
+ <testcase name="testAdd with data set #3" assertions="1" time="%f"/>
+ </testsuite>
+ </testsuite>
+</testsuites>
+
+
+Time: %i seconds
+
+There was 1 failure:
+
+1) testAdd(DataSetTest) with data set #2 (1, 1, 3)
+Failed asserting that <integer:2> matches expected value <integer:3>.
+%s:%i
+%s:%i
+
+FAILURES!
+Tests: 4, Assertions: 4, Failures: 1.
+
@@ -0,0 +1,21 @@
+<?php
+class DataSetTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider providerMethod
+ */
+ public function testAdd($a, $b, $c)
+ {
+ $this->assertEquals($c, $a + $b);
+ }
+
+ public static function providerMethod()
+ {
+ return array(
+ array(0, 0, 0),
+ array(0, 1, 1),
+ array(1, 1, 3),
+ array(1, 0, 1)
+ );
+ }
+}
View
@@ -794,6 +794,7 @@
<dir name="TextUI">
<file baseinstalldir="/" name="coverage-clover.phpt" role="test" />
<file baseinstalldir="/" name="coverage-source.phpt" role="test" />
+ <file baseinstalldir="/" name="dataset-log-xml.phpt" role="test" />
<file baseinstalldir="/" name="default.phpt" role="test" />
<file baseinstalldir="/" name="exclude-group.phpt" role="test" />
<file baseinstalldir="/" name="filter-class.phpt" role="test" />
@@ -844,6 +845,9 @@
<file baseinstalldir="/" name="ClassWithNonPublicAttributes.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
+ <file baseinstalldir="/" name="DataSetTest.php" role="test">
+ <tasks:replace from="@package_version@" to="version" type="package-info" />
+ </file>
<file baseinstalldir="/" name="DoubleTestCase.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>

0 comments on commit 4e930c9

Please sign in to comment.