Skip to content
Permalink
Browse files

Added skipped tag for phpunit xml (#57)

[JENKINS-42715] xUnit does not support PHPUnit 5.x skipped attribute

Support skipped attribute during PHPUnit validation. The attribute is supported since PHPUnit version 5.4/6.5 with the PR
* sebastianbergmann/phpunit#2144
  • Loading branch information...
rrehbein authored and nfalco79 committed May 7, 2018
1 parent 845615f commit bac21ed6b1627c486188efb7ed0501249b2f5819
@@ -38,6 +38,12 @@ THE SOFTWARE.
</xs:complexType>
</xs:element>

<xs:element name="skipped">
<xs:complexType mixed="true">
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>

<xs:element name="properties">
<xs:complexType>
<xs:sequence>
@@ -68,6 +74,7 @@ THE SOFTWARE.
<xs:element ref="failure" minOccurs="0" maxOccurs="1"/>
<xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
<xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
<xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="classname" type="xs:string" use="optional"/>
<xs:attribute name="name" type="xs:string" use="required"/>
@@ -61,4 +61,14 @@ public void testcase6() throws Exception {
public void testcase7() throws Exception {
convertAndValidate(PHPUnit.class, "phpunit/testcase7/testresult.xml", "phpunit/testcase7/junit-result.xml");
}

@Test
public void testcase8() throws Exception {
convertAndValidate(PHPUnit.class, "phpunit/testcase8/testresult.xml", "phpunit/testcase8/junit-result.xml");
}

@Test
public void testcase9() throws Exception {
convertAndValidate(PHPUnit.class, "phpunit/testcase9/testresult.xml", "phpunit/testcase9/junit-result.xml");
}
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" tests="2" failures="0" errors="0" skipped="2"
time="0.001106"
timestamp="">
<testcase classname="SampleTest" name="testSkippingTest" time="0.000948"
assertions="0"/>
<testcase classname="SampleTest" name="testSkippingTestWithReason" time="0.000158"
assertions="0"/>
</testsuite>
</testsuites>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" file="/tmp/sample/test.php" tests="2" assertions="0" errors="0" failures="0" skipped="2" time="0.001106">
<testcase name="testSkippingTest" class="SampleTest" file="/tmp/sample/test.php" line="7" assertions="0" time="0.000948">
<skipped/>
</testcase>
<testcase name="testSkippingTestWithReason" class="SampleTest" file="/tmp/sample/test.php" line="12" assertions="0" time="0.000158">
<skipped/>
</testcase>
</testsuite>
</testsuites>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" tests="2" failures="0" errors="0" skipped="2"
time="0.001725"
timestamp="">
<testcase classname="SampleTest" name="testSkippingTest" time="0.001648"
assertions="0"/>
<testcase classname="SampleTest" name="testSkippingTestWithReason" time="0.000077"
assertions="0"/>
</testsuite>
</testsuites>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="SampleTest" file="/tmp/sample/test.php" tests="2" assertions="0" errors="0" failures="0" skipped="2" time="0.001725">
<testcase name="testSkippingTest" class="SampleTest" classname="SampleTest" file="/tmp/sample/test.php" line="7" assertions="0" time="0.001648">
<skipped/>
</testcase>
<testcase name="testSkippingTestWithReason" class="SampleTest" classname="SampleTest" file="/tmp/sample/test.php" line="12" assertions="0" time="0.000077">
<skipped/>
</testcase>
</testsuite>
</testsuites>

0 comments on commit bac21ed

Please sign in to comment.
You can’t perform that action at this time.