Skip to content

Commit 4d71e5b

Browse files
committed
test: convert phpunit.xml to v10
and mark dataProvider functions as static in unit tests.
1 parent 52c9850 commit 4d71e5b

5 files changed

Lines changed: 13 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ composer.lock
44

55
# Tests
66
tests/cov/
7-
.phpunit.result.cache
7+
tests/.phpunit.cache
8+
tests/.phpunit.result.cache
89
.php_cs.cache
910
.php-cs-fixer.cache

tests/HTTP/FunctionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testGetHeaderValuesOnValues2(array $result, array $values1, arra
2121
/**
2222
* @return array<int, array<int, array<int, string>>>
2323
*/
24-
public function getHeaderValuesDataOnValues2(): array
24+
public static function getHeaderValuesDataOnValues2(): array
2525
{
2626
return [
2727
[
@@ -54,7 +54,7 @@ public function testGetHeaderValues($input, array $output): void
5454
/**
5555
* @return array<int, mixed>
5656
*/
57-
public function getHeaderValuesData(): array
57+
public static function getHeaderValuesData(): array
5858
{
5959
return [
6060
[
@@ -97,7 +97,7 @@ public function testPrefer($input, array $output): void
9797
/**
9898
* @return array<int, mixed>
9999
*/
100-
public function preferData(): array
100+
public static function preferData(): array
101101
{
102102
return [
103103
[

tests/HTTP/NegotiateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testNegotiate(?string $acceptHeader, array $available, ?string $
2222
/**
2323
* @return array<int, array<int, mixed>>
2424
*/
25-
public function negotiateData(): array
25+
public static function negotiateData(): array
2626
{
2727
return [
2828
[ // simple

tests/HTTP/SapiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function testSendContentRangeStream(
252252
/**
253253
* @return array<int, array<int, mixed>>
254254
*/
255-
public function sendContentRangeStreamData(): array
255+
public static function sendContentRangeStreamData(): array
256256
{
257257
return [
258258
['Ignore this. ', 'Send this.', 10, ' Ignore this at end.'],

tests/phpunit.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutTodoAnnotatedTests="true" bootstrap="bootstrap.php" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage includeUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">../lib/</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" failOnRisky="true" failOnWarning="true" bootstrap="bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" beStrictAboutCoverageMetadata="true">
83
<testsuites>
94
<testsuite name="Sabre_HTTP">
105
<directory>HTTP/</directory>
@@ -13,4 +8,9 @@
138
<php>
149
<env name="BASEURL" value="http://localhost:8000"/>
1510
</php>
11+
<source>
12+
<include>
13+
<directory suffix=".php">../lib/</directory>
14+
</include>
15+
</source>
1616
</phpunit>

0 commit comments

Comments
 (0)