mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 01:37:21 +01:00
feat: adds phpunit 12.2.1 support
This commit is contained in:
17
tests/Features/Covers/GuessCoverage.php
Normal file
17
tests/Features/Covers/GuessCoverage.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\CoversFunction;
|
||||
use Tests\Fixtures\Covers\CoversClass3;
|
||||
|
||||
function testCoversFunction2() {}
|
||||
|
||||
it('guesses if the given argument is a class or function', function () {
|
||||
$attributes = (new ReflectionClass($this))->getAttributes();
|
||||
|
||||
expect($attributes[1]->getName())->toBe(CoversClass::class);
|
||||
expect($attributes[1]->getArguments()[0])->toBe(CoversClass3::class);
|
||||
|
||||
expect($attributes[2]->getName())->toBe(CoversFunction::class);
|
||||
expect($attributes[2]->getArguments()[0])->toBe('testCoversFunction2');
|
||||
})->covers(CoversClass3::class, 'testCoversFunction2');
|
||||
Reference in New Issue
Block a user