Skip to content

Commit 9407847

Browse files
committed
Fix PHPUnit coverage report generation
1 parent 1d3f372 commit 9407847

33 files changed

+13
-435
lines changed

phpunit.xml.dist

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
3-
<phpunit
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
verbose="true"
7-
convertDeprecationsToExceptions="false"
8-
forceCoversAnnotation="true"
9-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php"
3+
colors="true" verbose="true" convertDeprecationsToExceptions="false"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
5+
<coverage>
6+
<include>
7+
<directory suffix=".php">src</directory>
8+
</include>
9+
<report>
10+
<clover outputFile="build/logs/clover.xml" />
11+
<html outputDirectory="build/coverage" lowUpperBound="35" highLowerBound="70" />
12+
</report>
13+
</coverage>
1014
<testsuites>
1115
<testsuite name="unit">
1216
<directory>./tests/unit/</directory>
1317
</testsuite>
1418
</testsuites>
15-
<filter>
16-
<whitelist>
17-
<directory suffix=".php">src</directory>
18-
</whitelist>
19-
</filter>
2019
<logging>
21-
<log type="coverage-html"
22-
target="build/coverage"
23-
lowUpperBound="35"
24-
highLowerBound="70" />
25-
<log type="coverage-clover" target="build/logs/clover.xml"/>
26-
<log type="junit" target="build/logs/junit.xml"/>
20+
<junit outputFile="build/logs/junit.xml" />
2721
</logging>
2822
</phpunit>

tests/unit/CollectionResolverTest.php

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
use PHPUnit\Framework\TestCase;
2828
use RuntimeException;
2929

30-
/**
31-
* @coversDefaultClass \phpDocumentor\Reflection\TypeResolver
32-
*/
3330
class CollectionResolverTest extends TestCase
3431
{
3532
/**
@@ -38,9 +35,6 @@ class CollectionResolverTest extends TestCase
3835
* @uses \phpDocumentor\Reflection\PseudoTypes\Generic
3936
* @uses \phpDocumentor\Reflection\Types\String_
4037
*
41-
* @covers ::resolve
42-
* @covers ::createType
43-
* @covers ::__construct
4438
*/
4539
public function testResolvingCollection(): void
4640
{
@@ -60,9 +54,6 @@ public function testResolvingCollection(): void
6054
* @uses \phpDocumentor\Reflection\PseudoTypes\Generic
6155
* @uses \phpDocumentor\Reflection\Types\String_
6256
*
63-
* @covers ::__construct
64-
* @covers ::resolve
65-
* @covers ::createType
6657
*/
6758
public function testResolvingCollectionWithKeyType(): void
6859
{
@@ -87,9 +78,6 @@ public function testResolvingCollectionWithKeyType(): void
8778
* @uses \phpDocumentor\Reflection\Types\Compound
8879
* @uses \phpDocumentor\Reflection\Types\String_
8980
*
90-
* @covers ::__construct
91-
* @covers ::resolve
92-
* @covers ::createType
9381
*/
9482
public function testResolvingArrayCollection(): void
9583
{
@@ -113,9 +101,6 @@ public function testResolvingArrayCollection(): void
113101
* @uses \phpDocumentor\Reflection\Types\Compound
114102
* @uses \phpDocumentor\Reflection\Types\String_
115103
*
116-
* @covers ::__construct
117-
* @covers ::resolve
118-
* @covers ::createType
119104
*/
120105
public function testResolvingArrayCollectionWithKey(): void
121106
{
@@ -139,9 +124,6 @@ public function testResolvingArrayCollectionWithKey(): void
139124
* @uses \phpDocumentor\Reflection\Types\Compound
140125
* @uses \phpDocumentor\Reflection\Types\String_
141126
142-
* @covers ::__construct
143-
* @covers ::resolve
144-
* @covers ::createType
145127
*/
146128
public function testResolvingArrayCollectionWithKeyAndWhitespace(): void
147129
{
@@ -166,9 +148,6 @@ public function testResolvingArrayCollectionWithKeyAndWhitespace(): void
166148
* @uses \phpDocumentor\Reflection\PseudoTypes\Generic
167149
* @uses \phpDocumentor\Reflection\Types\String_
168150
*
169-
* @covers ::__construct
170-
* @covers ::resolve
171-
* @covers ::createType
172151
*/
173152
public function testResolvingCollectionOfCollection(): void
174153
{
@@ -194,11 +173,6 @@ public function testResolvingCollectionOfCollection(): void
194173
$this->assertEquals(new Object_(new Fqsen('\\DateTime')), $nestedGenericTypes[0]);
195174
}
196175

197-
/**
198-
* @covers ::__construct
199-
* @covers ::resolve
200-
* @covers ::createType
201-
*/
202176
public function testGoodArrayCollectionKey(): void
203177
{
204178
$fixture = new TypeResolver();
@@ -214,11 +188,6 @@ public function testGoodArrayCollectionKey(): void
214188
$this->assertSame('array<class-string,string>', (string) $resolvedType);
215189
}
216190

217-
/**
218-
* @covers ::__construct
219-
* @covers ::resolve
220-
* @covers ::createType
221-
*/
222191
public function testMissingStartCollection(): void
223192
{
224193
$this->expectException(RuntimeException::class);
@@ -227,11 +196,6 @@ public function testMissingStartCollection(): void
227196
$fixture->resolve('<string>', new Context(''));
228197
}
229198

230-
/**
231-
* @covers ::__construct
232-
* @covers ::resolve
233-
* @covers ::createType
234-
*/
235199
public function testMissingEndCollection(): void
236200
{
237201
$this->expectException(RuntimeException::class);
@@ -240,11 +204,6 @@ public function testMissingEndCollection(): void
240204
$fixture->resolve('ArrayObject<object|string', new Context(''));
241205
}
242206

243-
/**
244-
* @covers ::__construct
245-
* @covers ::resolve
246-
* @covers ::createType
247-
*/
248207
public function testBadCollectionClass(): void
249208
{
250209
$this->expectException(RuntimeException::class);
@@ -258,9 +217,6 @@ public function testBadCollectionClass(): void
258217
* @uses \phpDocumentor\Reflection\Types\Compound
259218
* @uses \phpDocumentor\Reflection\Types\String_
260219
*
261-
* @covers ::__construct
262-
* @covers ::resolve
263-
* @covers ::createType
264220
*/
265221
public function testResolvingCollectionAsArray(): void
266222
{
@@ -283,9 +239,6 @@ public function testResolvingCollectionAsArray(): void
283239
* @uses \phpDocumentor\Reflection\Types\Context
284240
* @uses \phpDocumentor\Reflection\Types\String_
285241
*
286-
* @covers ::__construct
287-
* @covers ::resolve
288-
* @covers ::createType
289242
*/
290243
public function testResolvingList(): void
291244
{
@@ -308,9 +261,6 @@ public function testResolvingList(): void
308261
* @uses \phpDocumentor\Reflection\Types\Context
309262
* @uses \phpDocumentor\Reflection\Types\String_
310263
*
311-
* @covers ::__construct
312-
* @covers ::resolve
313-
* @covers ::createType
314264
*/
315265
public function testResolvingNonEmptyList(): void
316266
{
@@ -333,9 +283,6 @@ public function testResolvingNonEmptyList(): void
333283
* @uses \phpDocumentor\Reflection\Types\Context
334284
* @uses \phpDocumentor\Reflection\Types\Nullable
335285
*
336-
* @covers ::__construct
337-
* @covers ::resolve
338-
* @covers ::createType
339286
*/
340287
public function testResolvingNullableArray(): void
341288
{

tests/unit/FqsenResolverTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@
1717
use phpDocumentor\Reflection\Types\Context;
1818
use PHPUnit\Framework\TestCase;
1919

20-
/**
21-
* @coversDefaultClass \phpDocumentor\Reflection\FqsenResolver
22-
*/
2320
final class FqsenResolverTest extends TestCase
2421
{
25-
/**
26-
* @covers ::resolve
27-
*/
2822
public function testResolveFqsen(): void
2923
{
3024
$fqsenResolver = new FqsenResolver();
@@ -35,9 +29,6 @@ public function testResolveFqsen(): void
3529
static::assertSame('\DocBlock', (string) $result);
3630
}
3731

38-
/**
39-
* @covers ::resolve
40-
*/
4132
public function testResolveFqsenWithEmoji(): void
4233
{
4334
$fqsenResolver = new FqsenResolver();
@@ -48,9 +39,6 @@ public function testResolveFqsenWithEmoji(): void
4839
static::assertSame('\My😁DocBlock', (string) $result);
4940
}
5041

51-
/**
52-
* @covers ::resolve
53-
*/
5442
public function testResolveWithoutContext(): void
5543
{
5644
$fqsenResolver = new FqsenResolver();
@@ -59,9 +47,6 @@ public function testResolveWithoutContext(): void
5947
static::assertSame('\DocBlock', (string) $result);
6048
}
6149

62-
/**
63-
* @covers ::resolve
64-
*/
6550
public function testResolveFromAlias(): void
6651
{
6752
$fqsenResolver = new FqsenResolver();
@@ -72,9 +57,6 @@ public function testResolveFromAlias(): void
7257
static::assertSame('\some\other\ns', (string) $result);
7358
}
7459

75-
/**
76-
* @covers ::resolve
77-
*/
7860
public function testResolveFromPartialAlias(): void
7961
{
8062
$fqsenResolver = new FqsenResolver();
@@ -85,9 +67,6 @@ public function testResolveFromPartialAlias(): void
8567
static::assertSame('\some\other\ns', (string) $result);
8668
}
8769

88-
/**
89-
* @covers ::resolve
90-
*/
9170
public function testResolveThrowsExceptionWhenGarbageInputIsPassed(): void
9271
{
9372
$this->expectException(InvalidArgumentException::class);

tests/unit/IntegerRangeResolverTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,13 @@
1818
use PHPUnit\Framework\TestCase;
1919
use RuntimeException;
2020

21-
/**
22-
* @coversDefaultClass \phpDocumentor\Reflection\TypeResolver
23-
*/
2421
class IntegerRangeResolverTest extends TestCase
2522
{
2623
/**
2724
* @uses \phpDocumentor\Reflection\Types\Context
2825
* @uses \phpDocumentor\Reflection\Types\Compound
2926
* @uses \phpDocumentor\Reflection\Types\String_
3027
*
31-
* @covers ::__construct
32-
* @covers ::resolve
33-
* @covers ::createType
3428
*/
3529
public function testResolvingIntRange(): void
3630
{
@@ -53,9 +47,6 @@ public function testResolvingIntRange(): void
5347
* @uses \phpDocumentor\Reflection\Types\Compound
5448
* @uses \phpDocumentor\Reflection\Types\String_
5549
*
56-
* @covers ::__construct
57-
* @covers ::resolve
58-
* @covers ::createType
5950
*/
6051
public function testResolvingIntRangeWithKeywords(): void
6152
{
@@ -78,9 +69,6 @@ public function testResolvingIntRangeWithKeywords(): void
7869
* @uses \phpDocumentor\Reflection\Types\Compound
7970
* @uses \phpDocumentor\Reflection\Types\String_
8071
*
81-
* @covers ::__construct
82-
* @covers ::resolve
83-
* @covers ::createType
8472
*/
8573
public function testResolvingIntRangeErrorMissingMaxValue(): void
8674
{
@@ -96,9 +84,6 @@ public function testResolvingIntRangeErrorMissingMaxValue(): void
9684
* @uses \phpDocumentor\Reflection\Types\Compound
9785
* @uses \phpDocumentor\Reflection\Types\String_
9886
*
99-
* @covers ::__construct
100-
* @covers ::resolve
101-
* @covers ::createType
10287
*/
10388
public function testResolvingIntRangeErrorMisingMinValue(): void
10489
{
@@ -114,9 +99,6 @@ public function testResolvingIntRangeErrorMisingMinValue(): void
11499
* @uses \phpDocumentor\Reflection\Types\Compound
115100
* @uses \phpDocumentor\Reflection\Types\String_
116101
*
117-
* @covers ::__construct
118-
* @covers ::resolve
119-
* @covers ::createType
120102
*/
121103
public function testResolvingIntRangeErrorMisingComma(): void
122104
{
@@ -132,9 +114,6 @@ public function testResolvingIntRangeErrorMisingComma(): void
132114
* @uses \phpDocumentor\Reflection\Types\Compound
133115
* @uses \phpDocumentor\Reflection\Types\String_
134116
*
135-
* @covers ::__construct
136-
* @covers ::resolve
137-
* @covers ::createType
138117
*/
139118
public function testResolvingIntRangeErrorMissingEnd(): void
140119
{

tests/unit/NumericResolverTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,13 @@
2020
use phpDocumentor\Reflection\Types\String_;
2121
use PHPUnit\Framework\TestCase;
2222

23-
/**
24-
* @coversDefaultClass \phpDocumentor\Reflection\TypeResolver
25-
*/
2623
class NumericResolverTest extends TestCase
2724
{
2825
/**
2926
* @uses \phpDocumentor\Reflection\Types\Context
3027
* @uses \phpDocumentor\Reflection\Types\Compound
3128
* @uses \phpDocumentor\Reflection\Types\String_
3229
*
33-
* @covers ::__construct
3430
*/
3531
public function testResolvingIntRange(): void
3632
{

tests/unit/PseudoTypes/ArrayKeyTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,8 @@
1717
use phpDocumentor\Reflection\Types\String_;
1818
use PHPUnit\Framework\TestCase;
1919

20-
/**
21-
* @coversDefaultClass \phpDocumentor\Reflection\PseudoTypes\ArrayKey
22-
*/
2320
final class ArrayKeyTest extends TestCase
2421
{
25-
/**
26-
* @covers ::__construct
27-
* @covers ::__toString
28-
*/
2922
public function testArrayKeyCanBeConstructedAndStringifiedCorrectly(): void
3023
{
3124
$this->assertSame('array-key', (string) (new ArrayKey()));
@@ -34,7 +27,6 @@ public function testArrayKeyCanBeConstructedAndStringifiedCorrectly(): void
3427
/**
3528
* @uses \phpDocumentor\Reflection\PseudoTypes\ArrayKey::__construct
3629
*
37-
* @covers ::getIterator
3830
*/
3931
public function testArrayKeyCanBeIterated(): void
4032
{

tests/unit/PseudoTypes/ArrayShapeTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66

77
use PHPUnit\Framework\TestCase;
88

9-
/**
10-
* @coversDefaultClass \phpDocumentor\Reflection\PseudoTypes\ArrayShape
11-
*/
129
class ArrayShapeTest extends TestCase
1310
{
14-
/**
15-
* @covers ::getItems
16-
*/
1711
public function testExposeItems(): void
1812
{
1913
$item1 = new ArrayShapeItem('foo', new True_(), false);
@@ -26,7 +20,6 @@ public function testExposeItems(): void
2620

2721
/**
2822
* @dataProvider provideToStringData
29-
* @covers ::__toString
3023
*/
3124
public function testToString(string $expectedResult, ArrayShape $arrayShape): void
3225
{

0 commit comments

Comments
 (0)