Update PHPStan and fix wrong @covers annotations

This commit is contained in:
Jérôme Gamez
2025-09-12 16:04:10 +02:00
parent 5a0bf8fdba
commit d623da43da
3 changed files with 22 additions and 22 deletions
+9 -9
View File
@@ -6,6 +6,8 @@ namespace Beste\Clock\Tests;
use Beste\Clock\FrozenClock;
use Beste\Clock\WrappingClock;
use DateTimeImmutable;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
/**
@@ -18,7 +20,7 @@ final class WrappingClockTest extends TestCase
* @test
*
* @covers ::__construct
* @covers ::create
* @covers ::wrapping
* @covers ::now
*/
public function itWrapsAClockInterface(): void
@@ -36,23 +38,21 @@ final class WrappingClockTest extends TestCase
/**
* @test
*
* @covers ::__construct
* @covers ::create
* @covers ::now
* @covers ::wrapping
*/
public function itWrapsAnObjectWithANowMethod(): void
{
$now = FrozenClock::fromUTC()->now();
$clock = new class($now) {
private \DateTimeImmutable $now;
private DateTimeImmutable $now;
public function __construct(\DateTimeImmutable $now)
public function __construct(DateTimeImmutable $now)
{
$this->now = $now;
}
public function now(): \DateTimeImmutable
public function now(): DateTimeImmutable
{
return $this->now;
}
@@ -69,7 +69,7 @@ final class WrappingClockTest extends TestCase
/**
* @test
*
* @covers ::create
* @covers ::wrapping
*/
public function itRejectsObjectsWithANowMethodReturningANonDateTimeImmutable(): void
{
@@ -80,7 +80,7 @@ final class WrappingClockTest extends TestCase
}
};
$this->expectException(\InvalidArgumentException::class);
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('$clock->now() must return a DateTimeImmutable');
WrappingClock::wrapping($clock);