Skip to content

Commit 99be1a7

Browse files
committed
Import "JunitErrorFormatterTest - do not rely on internet and GitHub being up"
Source: phpstan/phpstan-src@e5e7580
1 parent 08d91ae commit 99be1a7

File tree

2 files changed

+117
-1
lines changed

2 files changed

+117
-1
lines changed

tests/ErrorFormatter/JunitErrorFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function testFormatErrors(
180180
$xml->loadXML($this->getOutputContent());
181181

182182
$this->assertTrue(
183-
$xml->schemaValidate('https://raw.githubusercontent.com/junit-team/junit5/r5.5.1/platform-tests/src/test/resources/jenkins-junit.xsd'),
183+
$xml->schemaValidate(__DIR__ . '/junit-schema.xsd'),
184184
'Schema do not validate'
185185
);
186186

tests/ErrorFormatter/junit-schema.xsd

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
Source: https://svn.jenkins-ci.org/trunk/hudson/dtkit/dtkit-format/dtkit-junit-model/src/main/resources/com/thalesgroup/dtkit/junit/model/xsd/junit-4.xsd
4+
This file available under the terms of the MIT License as follows:
5+
*******************************************************************************
6+
* Copyright (c) 2010 Thales Corporate Services SAS *
7+
* *
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy *
9+
* of this software and associated documentation files (the "Software"), to deal*
10+
* in the Software without restriction, including without limitation the rights *
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
12+
* copies of the Software, and to permit persons to whom the Software is *
13+
* furnished to do so, subject to the following conditions: *
14+
* *
15+
* The above copyright notice and this permission notice shall be included in *
16+
* all copies or substantial portions of the Software. *
17+
* *
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,*
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
24+
* THE SOFTWARE. *
25+
********************************************************************************
26+
-->
27+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
28+
29+
<xs:element name="failure">
30+
<xs:complexType mixed="true">
31+
<xs:attribute name="type" type="xs:string" use="optional"/>
32+
<xs:attribute name="message" type="xs:string" use="optional"/>
33+
</xs:complexType>
34+
</xs:element>
35+
36+
<xs:element name="error">
37+
<xs:complexType mixed="true">
38+
<xs:attribute name="type" type="xs:string" use="optional"/>
39+
<xs:attribute name="message" type="xs:string" use="optional"/>
40+
</xs:complexType>
41+
</xs:element>
42+
43+
<xs:element name="properties">
44+
<xs:complexType>
45+
<xs:sequence>
46+
<xs:element ref="property" maxOccurs="unbounded"/>
47+
</xs:sequence>
48+
</xs:complexType>
49+
</xs:element>
50+
51+
<xs:element name="property">
52+
<xs:complexType>
53+
<xs:attribute name="name" type="xs:string" use="required"/>
54+
<xs:attribute name="value" type="xs:string" use="required"/>
55+
</xs:complexType>
56+
</xs:element>
57+
58+
<xs:element name="skipped" type="xs:string"/>
59+
<xs:element name="system-err" type="xs:string"/>
60+
<xs:element name="system-out" type="xs:string"/>
61+
62+
<xs:element name="testcase">
63+
<xs:complexType>
64+
<xs:sequence>
65+
<xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
66+
<xs:element ref="error" minOccurs="0" maxOccurs="unbounded"/>
67+
<xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
68+
<xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
69+
<xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
70+
</xs:sequence>
71+
<xs:attribute name="name" type="xs:string" use="required"/>
72+
<xs:attribute name="assertions" type="xs:string" use="optional"/>
73+
<xs:attribute name="time" type="xs:string" use="optional"/>
74+
<xs:attribute name="classname" type="xs:string" use="optional"/>
75+
<xs:attribute name="status" type="xs:string" use="optional"/>
76+
</xs:complexType>
77+
</xs:element>
78+
79+
<xs:element name="testsuite">
80+
<xs:complexType>
81+
<xs:sequence>
82+
<xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
83+
<xs:element ref="testcase" minOccurs="0" maxOccurs="unbounded"/>
84+
<xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
85+
<xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
86+
</xs:sequence>
87+
<xs:attribute name="name" type="xs:string" use="required"/>
88+
<xs:attribute name="tests" type="xs:string" use="required"/>
89+
<xs:attribute name="failures" type="xs:string" use="optional"/>
90+
<xs:attribute name="errors" type="xs:string" use="optional"/>
91+
<xs:attribute name="time" type="xs:string" use="optional"/>
92+
<xs:attribute name="disabled" type="xs:string" use="optional"/>
93+
<xs:attribute name="skipped" type="xs:string" use="optional"/>
94+
<xs:attribute name="timestamp" type="xs:string" use="optional"/>
95+
<xs:attribute name="hostname" type="xs:string" use="optional"/>
96+
<xs:attribute name="id" type="xs:string" use="optional"/>
97+
<xs:attribute name="package" type="xs:string" use="optional"/>
98+
</xs:complexType>
99+
</xs:element>
100+
101+
<xs:element name="testsuites">
102+
<xs:complexType>
103+
<xs:sequence>
104+
<xs:element ref="testsuite" minOccurs="0" maxOccurs="unbounded"/>
105+
</xs:sequence>
106+
<xs:attribute name="name" type="xs:string" use="optional"/>
107+
<xs:attribute name="time" type="xs:string" use="optional"/>
108+
<xs:attribute name="tests" type="xs:string" use="optional"/>
109+
<xs:attribute name="failures" type="xs:string" use="optional"/>
110+
<xs:attribute name="disabled" type="xs:string" use="optional"/>
111+
<xs:attribute name="errors" type="xs:string" use="optional"/>
112+
</xs:complexType>
113+
</xs:element>
114+
115+
116+
</xs:schema>

0 commit comments

Comments
 (0)