chore: upgrade phpunit to 12.5

This commit is contained in:
fromme committed 2026-10-01 10:07:05 +02:00
1 parent da039d0527
commit 849da8d471
53 files changed
+832 -856

No files matched your search

+8 -11
View File
@@ -12,10 +12,9 @@ use App\Entity\JobProfile;
use App\Entity\Teamer;
use App\Entity\Upload;
use App\Service\Pdf\InvoiceApprover;
use App\Service\Pdf\InvoiceRenderer;
use App\Service\Pdf\Pdf;
use App\Service\Upload\UploadHandler;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Contracts\Translation\TranslatorInterface;
@@ -27,7 +26,7 @@ class InvoiceApproverTest extends WebTestCase
private string $pdfPath;
private string $origPath;
private Filesystem $filesystem;
private UploadHandler&MockObject $uploadHandler;
private UploadHandler&Stub $uploadHandler;
protected function setUp(): void
{
@@ -38,7 +37,7 @@ class InvoiceApproverTest extends WebTestCase
$this->pdfPath = $this->invoiceDir.'/test_approver_backup.pdf';
$this->origPath = $this->invoiceDir.'/test_approver_backup.orig.pdf';
$this->filesystem = new Filesystem();
$this->uploadHandler = $this->createMock(UploadHandler::class);
$this->uploadHandler = $this->createStub(UploadHandler::class);
$this->filesystem->mkdir($this->invoiceDir);
}
@@ -81,10 +80,7 @@ class InvoiceApproverTest extends WebTestCase
private function createApprover(): InvoiceApprover
{
$translator = $this->createMock(TranslatorInterface::class);
/** @var TranslatorInterface $translator */
return new InvoiceApprover($translator, ['project_dir' => $this->projectDir], $this->uploadHandler);
return new InvoiceApprover($this->createStub(TranslatorInterface::class), ['project_dir' => $this->projectDir], $this->uploadHandler);
}
private function createDispositionWithInvoicePdf(): Disposition
@@ -109,7 +105,7 @@ class InvoiceApproverTest extends WebTestCase
$jobProfile->setName('Testprofil');
$jobProfile->setCostUnit('200');
$assignment = $this->createMock(Assignment::class);
$assignment = $this->createStub(Assignment::class);
$assignment->method('getDestination')->willReturn($destination);
$assignment->method('getJobProfile')->willReturn($jobProfile);
@@ -134,8 +130,9 @@ class InvoiceApproverTest extends WebTestCase
;
$disposition->addDocument($invoice);
$this->uploadHandler->method('getResolvedUploadFilepath')->with($invoice)->willReturn($this->pdfPath);
$this->uploadHandler->method('getUploadFilepath')->with($invoice)->willReturn($this->pdfPath);
$filepath = fn (Upload $upload): string => $invoice === $upload ? $this->pdfPath : throw new \LogicException('Unexpected upload');
$this->uploadHandler->method('getResolvedUploadFilepath')->willReturnCallback($filepath);
$this->uploadHandler->method('getUploadFilepath')->willReturnCallback($filepath);
return $disposition;
}