|
34 | 34 | use PHPUnit\TestFixture\CoverageMethodTest; |
35 | 35 | use PHPUnit\TestFixture\CoverageNamespacedFunctionTest; |
36 | 36 | use PHPUnit\TestFixture\CoverageNoneTest; |
| 37 | +use PHPUnit\TestFixture\CoverageTraitMethodTest; |
| 38 | +use PHPUnit\TestFixture\CoverageTraitTest; |
37 | 39 | use PHPUnit\TestFixture\InterfaceAsTargetWithAttributeTest; |
38 | 40 | use PHPUnit\TestFixture\InterfaceTargetTest; |
39 | 41 | use PHPUnit\TestFixture\InvalidClassTargetWithAnnotationTest; |
@@ -206,6 +208,22 @@ public static function linesToBeCoveredProvider(): array |
206 | 208 | Test3194::class, |
207 | 209 | 'testOne', |
208 | 210 | ], |
| 211 | + |
| 212 | + [ |
| 213 | + [ |
| 214 | + TEST_FILES_PATH . 'CoveredTrait.php' => range(12, 18), |
| 215 | + ], |
| 216 | + CoverageTraitTest::class, |
| 217 | + 'testSomething', |
| 218 | + ], |
| 219 | + |
| 220 | + [ |
| 221 | + [ |
| 222 | + TEST_FILES_PATH . 'CoveredTrait.php' => range(14, 17), |
| 223 | + ], |
| 224 | + CoverageTraitMethodTest::class, |
| 225 | + 'testSomething', |
| 226 | + ], |
209 | 227 | ]; |
210 | 228 | } |
211 | 229 |
|
@@ -321,6 +339,22 @@ public static function linesToBeUsedProvider(): array |
321 | 339 | CoverageNamespacedFunctionTest::class, |
322 | 340 | 'testFunc', |
323 | 341 | ], |
| 342 | + |
| 343 | + [ |
| 344 | + [ |
| 345 | + TEST_FILES_PATH . 'CoveredTrait.php' => range(12, 18), |
| 346 | + ], |
| 347 | + CoverageTraitTest::class, |
| 348 | + 'testSomething', |
| 349 | + ], |
| 350 | + |
| 351 | + [ |
| 352 | + [ |
| 353 | + TEST_FILES_PATH . 'CoveredTrait.php' => range(14, 17), |
| 354 | + ], |
| 355 | + CoverageTraitMethodTest::class, |
| 356 | + 'testSomething', |
| 357 | + ], |
324 | 358 | ]; |
325 | 359 | } |
326 | 360 |
|
@@ -423,15 +457,15 @@ public function testRejectsInterfaceAsUsesClassTargetWithAttribute(): void |
423 | 457 | public function testRejectsInvalidCoversClassTargetWithAttribute(): void |
424 | 458 | { |
425 | 459 | $this->expectException(CodeCoverageException::class); |
426 | | - $this->expectExceptionMessage('Class "InvalidClass" is not a valid target for code coverage'); |
| 460 | + $this->expectExceptionMessage('"InvalidClass" is not a valid target for code coverage'); |
427 | 461 |
|
428 | 462 | (new CodeCoverage)->linesToBeCovered(InvalidClassTargetWithAttributeTest::class, 'testOne'); |
429 | 463 | } |
430 | 464 |
|
431 | 465 | public function testRejectsInvalidUsesClassTargetWithAttribute(): void |
432 | 466 | { |
433 | 467 | $this->expectException(CodeCoverageException::class); |
434 | | - $this->expectExceptionMessage('Class "InvalidClass" is not a valid target for code coverage'); |
| 468 | + $this->expectExceptionMessage('"InvalidClass" is not a valid target for code coverage'); |
435 | 469 |
|
436 | 470 | (new CodeCoverage)->linesToBeUsed(InvalidClassTargetWithAttributeTest::class, 'testOne'); |
437 | 471 | } |
|
0 commit comments