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

@@ -18,24 +18,27 @@ use App\Saas\Model\EmployeeDirectory;
use App\Saas\ResponseParser;
use App\Service\Saas\WorkHoursSynchronizer;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
#[AllowMockObjectsWithoutExpectations]
class WorkHoursSynchronizerTest extends TestCase
{
private ApiClient&MockObject $apiClient;
private EmployeeDataProvider&MockObject $employeeDataProvider;
private TeamerWorkMonthRepository&MockObject $workMonthRepository;
private EmployeeDataProvider&Stub $employeeDataProvider;
private TeamerWorkMonthRepository&Stub $workMonthRepository;
private EntityManagerInterface&MockObject $entityManager;
private WorkHoursSynchronizer $synchronizer;
protected function setUp(): void
{
$this->apiClient = $this->createMock(ApiClient::class);
$this->workMonthRepository = $this->createMock(TeamerWorkMonthRepository::class);
$this->workMonthRepository = $this->createStub(TeamerWorkMonthRepository::class);
$this->entityManager = $this->createMock(EntityManagerInterface::class);
$this->employeeDataProvider = $this->createMock(EmployeeDataProvider::class);
$this->employeeDataProvider = $this->createStub(EmployeeDataProvider::class);
// Registered by default; the tests that care say otherwise.
$this->employeeDataProvider->method('getDirectory')->willReturn(
@@ -48,7 +51,7 @@ class WorkHoursSynchronizerTest extends TestCase
$this->apiClient,
new ResponseParser(),
$this->employeeDataProvider,
$this->createMock(TeamerRepository::class),
$this->createStub(TeamerRepository::class),
$this->workMonthRepository,
$this->entityManager,
new NullLogger(),
@@ -85,7 +88,7 @@ class WorkHoursSynchronizerTest extends TestCase
*/
public function testATeamerMissingFromTheRosterIsSkippedWithoutAnyRequest(): void
{
$provider = $this->createMock(EmployeeDataProvider::class);
$provider = $this->createStub(EmployeeDataProvider::class);
$provider->method('getDirectory')->willReturn(
EmployeeDirectory::fromEmployees([new Employee('[email protected]', 'e-9', 'Service', false)])
);
@@ -97,7 +100,7 @@ class WorkHoursSynchronizerTest extends TestCase
$apiClient,
new ResponseParser(),
$provider,
$this->createMock(TeamerRepository::class),
$this->createStub(TeamerRepository::class),
$this->workMonthRepository,
$this->entityManager,
new NullLogger(),
@@ -115,7 +118,7 @@ class WorkHoursSynchronizerTest extends TestCase
*/
public function testAnUnreachableRosterDoesNotSkipEveryone(): void
{
$provider = $this->createMock(EmployeeDataProvider::class);
$provider = $this->createStub(EmployeeDataProvider::class);
$provider->method('getDirectory')->willReturn(EmployeeDirectory::fromEmployees([]));
$this->apiClient->method('getTimeAccount')->willReturn($this->payload());
@@ -125,7 +128,7 @@ class WorkHoursSynchronizerTest extends TestCase
$this->apiClient,
new ResponseParser(),
$provider,
$this->createMock(TeamerRepository::class),
$this->createStub(TeamerRepository::class),
$this->workMonthRepository,
$this->entityManager,
new NullLogger(),