test: disable constructor when mocking RDAPService

This commit is contained in:
Maël Gangloff
2025-10-22 16:14:02 +02:00
parent 95c6b9bb55
commit e3b3881baf

View File

@@ -10,9 +10,9 @@ use App\Entity\DomainStatus;
use App\Exception\MalformedDomainException; use App\Exception\MalformedDomainException;
use App\Service\RDAPService; use App\Service\RDAPService;
use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
final class DomainTest extends TestCase final class DomainTest extends KernelTestCase
{ {
public function testIsRedemptionPeriod(): void public function testIsRedemptionPeriod(): void
{ {
@@ -234,6 +234,7 @@ final class DomainTest extends TestCase
bool $expected, bool $expected,
): void { ): void {
$rdapServiceMock = $this->getMockBuilder(RDAPService::class) $rdapServiceMock = $this->getMockBuilder(RDAPService::class)
->disableOriginalConstructor()
->onlyMethods(['getExpiresInDays']) ->onlyMethods(['getExpiresInDays'])
->getMock(); ->getMock();