File: basic-test-case-class-source-file-as-cli-argument-with-git-information.phpt

package info (click to toggle)
phpunit 12.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 50,160 kB
  • sloc: php: 101,772; xml: 2,084; makefile: 124; sh: 99
file content (234 lines) | stat: -rw-r--r-- 8,196 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
--TEST--
phpunit --log-otr /path/to/logfile --include-git-information ../_files/StatusTest.php
--FILE--
<?php declare(strict_types=1);
use function PHPUnit\TestFixture\validate_and_print;

$logfile = tempnam(sys_get_temp_dir(), __FILE__);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-otr';
$_SERVER['argv'][] = $logfile;
$_SERVER['argv'][] = '--include-git-information';
$_SERVER['argv'][] = __DIR__ . '/../_files/status/tests/StatusTest.php';

require __DIR__ . '/../../../bootstrap.php';
require __DIR__ . '/validate_and_print.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

validate_and_print($logfile);

unlink($logfile);
--EXPECTF--
<?xml version="1.0"?>
<e:events xmlns="https://schemas.opentest4j.org/reporting/core/0.2.0" xmlns:e="https://schemas.opentest4j.org/reporting/events/0.2.0" xmlns:git="https://schemas.opentest4j.org/reporting/git/0.2.0" xmlns:php="https://schema.phpunit.de/otr/php/0.0.1" xmlns:phpunit="https://schema.phpunit.de/otr/phpunit/0.0.1">
 <infrastructure>
  <hostName>%s</hostName>
  <userName>%s</userName>
  <operatingSystem>%s</operatingSystem>
  <php:phpVersion>%s</php:phpVersion>
  <php:threadModel>%s</php:threadModel>
  <git:repository originUrl="%s"/>
  <git:branch>%s</git:branch>
  <git:commit>%s</git:commit>
  <git:status clean="%s"><![CDATA[%A]]></git:status>
 </infrastructure>
 <e:started id="1" name="PHPUnit\TestFixture\Basic\StatusTest" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:classSource className="PHPUnit\TestFixture\Basic\StatusTest"/>
  </sources>
 </e:started>
 <e:started id="2" parentId="1" name="testSuccess" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testSuccess"/>
  </sources>
 </e:started>
 <e:finished id="2" time="%s">
  <result status="SUCCESSFUL"/>
 </e:finished>
 <e:started id="3" parentId="1" name="testFailure" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testFailure"/>
  </sources>
 </e:started>
 <e:finished id="3" time="%s">
  <result status="FAILED">
   <reason>Failed asserting that false is true.</reason>
   <phpunit:throwable type="PHPUnit\Framework\ExpectationFailedException" assertionError="true"><![CDATA[Failed asserting that false is true.

%sStatusTest.php:%d
]]></phpunit:throwable>
  </result>
 </e:finished>
 <e:started id="4" parentId="1" name="testError" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testError"/>
  </sources>
 </e:started>
 <e:finished id="4" time="%s">
  <result status="ERRORED">
   <reason></reason>
   <phpunit:throwable type="RuntimeException" assertionError="false"><![CDATA[RuntimeException: 

%sStatusTest.php:%d
]]></phpunit:throwable>
  </result>
 </e:finished>
 <e:started id="5" parentId="1" name="testIncomplete" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testIncomplete"/>
  </sources>
 </e:started>
 <e:finished id="5" time="%s">
  <result status="ABORTED">
   <reason></reason>
   <phpunit:throwable type="PHPUnit\Framework\IncompleteTestError" assertionError="false"><![CDATA[
%sStatusTest.php:%d
]]></phpunit:throwable>
  </result>
 </e:finished>
 <e:started id="6" parentId="1" name="testSkipped" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testSkipped"/>
  </sources>
 </e:started>
 <e:finished id="6" time="%s">
  <result status="SKIPPED">
   <reason></reason>
  </result>
 </e:finished>
 <e:started id="7" parentId="1" name="testRisky" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testRisky"/>
  </sources>
 </e:started>
 <e:finished id="7" time="%s">
  <result status="SUCCESSFUL"/>
 </e:finished>
 <e:started id="8" parentId="1" name="testSuccessWithMessage" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testSuccessWithMessage"/>
  </sources>
 </e:started>
 <e:finished id="8" time="%s">
  <result status="SUCCESSFUL"/>
 </e:finished>
 <e:started id="9" parentId="1" name="testFailureWithMessage" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testFailureWithMessage"/>
  </sources>
 </e:started>
 <e:finished id="9" time="%s">
  <result status="FAILED">
   <reason>failure with custom message
Failed asserting that false is true.</reason>
   <phpunit:throwable type="PHPUnit\Framework\ExpectationFailedException" assertionError="true"><![CDATA[failure with custom message
Failed asserting that false is true.

%sStatusTest.php:%d
]]></phpunit:throwable>
  </result>
 </e:finished>
 <e:started id="10" parentId="1" name="testErrorWithMessage" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testErrorWithMessage"/>
  </sources>
 </e:started>
 <e:finished id="10" time="%s">
  <result status="ERRORED">
   <reason>error with custom message</reason>
   <phpunit:throwable type="RuntimeException" assertionError="false"><![CDATA[RuntimeException: error with custom message

%sStatusTest.php:%d
]]></phpunit:throwable>
  </result>
 </e:finished>
 <e:started id="11" parentId="1" name="testIncompleteWithMessage" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testIncompleteWithMessage"/>
  </sources>
 </e:started>
 <e:finished id="11" time="%s">
  <result status="ABORTED">
   <reason>incomplete with custom message</reason>
   <phpunit:throwable type="PHPUnit\Framework\IncompleteTestError" assertionError="false"><![CDATA[incomplete with custom message

%sStatusTest.php:%d
]]></phpunit:throwable>
  </result>
 </e:finished>
 <e:started id="12" parentId="1" name="testSkippedByMetadata" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testSkippedByMetadata"/>
  </sources>
 </e:started>
 <e:finished id="12" time="%s">
  <result status="SKIPPED">
   <reason>PHP &gt; 9000 is required.</reason>
  </result>
 </e:finished>
 <e:started id="13" parentId="1" name="testSkippedWithMessage" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testSkippedWithMessage"/>
  </sources>
 </e:started>
 <e:finished id="13" time="%s">
  <result status="SKIPPED">
   <reason>skipped with custom message</reason>
  </result>
 </e:finished>
 <e:started id="14" parentId="1" name="testRiskyWithMessage" time="%s">
  <sources>
   <fileSource path="%sStatusTest.php">
    <filePosition line="%d"/>
   </fileSource>
   <phpunit:methodSource className="PHPUnit\TestFixture\Basic\StatusTest" methodName="testRiskyWithMessage"/>
  </sources>
 </e:started>
 <e:finished id="14" time="%s">
  <result status="SUCCESSFUL"/>
 </e:finished>
 <e:finished id="1" time="%s"/>
</e:events>