feat: replace *Service suffix with role-based class names
This commit is contained in:
@@ -13,9 +13,9 @@ use App\Form\Model\BookingMutabilityDto;
|
||||
use App\Form\Model\BookingEditContext;
|
||||
use App\Form\Model\BookingSummaryDto;
|
||||
use App\Service\BookingEditContextFactory;
|
||||
use App\Service\BookingSummaryDataService;
|
||||
use App\Service\ParticipantCardDataService;
|
||||
use App\Service\TravelDataService;
|
||||
use App\Service\BookingSummaryAssembler;
|
||||
use App\Service\ParticipantCardAssembler;
|
||||
use App\Service\TravelDataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class BookingEditContextFactoryTest extends TestCase
|
||||
@@ -27,14 +27,14 @@ class BookingEditContextFactoryTest extends TestCase
|
||||
$travel->dateTo = new \DateTimeImmutable('2030-01-06');
|
||||
$bookingDto = new BookingDto($travel, 157047);
|
||||
|
||||
$travelDataService = $this->createMock(TravelDataService::class);
|
||||
$travelDataService = $this->createMock(TravelDataProvider::class);
|
||||
$travelDataService->expects($this->once())
|
||||
->method('enrichWithFreshAvailabilities')
|
||||
->with($travel);
|
||||
|
||||
$service = new BookingEditContextFactory(
|
||||
$this->createMock(ParticipantCardDataService::class),
|
||||
$this->createMock(BookingSummaryDataService::class),
|
||||
$this->createMock(ParticipantCardAssembler::class),
|
||||
$this->createMock(BookingSummaryAssembler::class),
|
||||
$travelDataService,
|
||||
);
|
||||
|
||||
@@ -58,20 +58,20 @@ class BookingEditContextFactoryTest extends TestCase
|
||||
]);
|
||||
$summaryData = $this->createMock(BookingSummaryDto::class);
|
||||
|
||||
$summaryDataService = $this->createMock(BookingSummaryDataService::class);
|
||||
$summaryDataService = $this->createMock(BookingSummaryAssembler::class);
|
||||
$summaryDataService->expects($this->once())
|
||||
->method('getSummaryData')
|
||||
->with($bookingDto)
|
||||
->willReturn($summaryData);
|
||||
|
||||
$travelDataService = $this->createMock(TravelDataService::class);
|
||||
$travelDataService = $this->createMock(TravelDataProvider::class);
|
||||
$travelDataService->expects($this->once())
|
||||
->method('getMutabilityData')
|
||||
->with(1234)
|
||||
->willReturn($mutableData);
|
||||
|
||||
$service = new BookingEditContextFactory(
|
||||
$this->createMock(ParticipantCardDataService::class),
|
||||
$this->createMock(ParticipantCardAssembler::class),
|
||||
$summaryDataService,
|
||||
$travelDataService,
|
||||
);
|
||||
@@ -96,18 +96,18 @@ class BookingEditContextFactoryTest extends TestCase
|
||||
$bookingDto = new BookingDto($travel, 157047);
|
||||
$summaryData = $this->createMock(BookingSummaryDto::class);
|
||||
|
||||
$summaryDataService = $this->createMock(BookingSummaryDataService::class);
|
||||
$summaryDataService = $this->createMock(BookingSummaryAssembler::class);
|
||||
$summaryDataService->expects($this->once())
|
||||
->method('getSummaryData')
|
||||
->with($bookingDto)
|
||||
->willReturn($summaryData);
|
||||
|
||||
$travelDataService = $this->createMock(TravelDataService::class);
|
||||
$travelDataService = $this->createMock(TravelDataProvider::class);
|
||||
$travelDataService->expects($this->never())
|
||||
->method('getMutabilityData');
|
||||
|
||||
$service = new BookingEditContextFactory(
|
||||
$this->createMock(ParticipantCardDataService::class),
|
||||
$this->createMock(ParticipantCardAssembler::class),
|
||||
$summaryDataService,
|
||||
$travelDataService,
|
||||
);
|
||||
@@ -135,19 +135,19 @@ class BookingEditContextFactoryTest extends TestCase
|
||||
$summaryData = $this->createMock(BookingSummaryDto::class);
|
||||
$cardsData = [];
|
||||
|
||||
$participantCardDataService = $this->createMock(ParticipantCardDataService::class);
|
||||
$participantCardDataService = $this->createMock(ParticipantCardAssembler::class);
|
||||
$participantCardDataService->expects($this->once())
|
||||
->method('getAllCardsDataWithValidation')
|
||||
->with($bookingDto)
|
||||
->willReturn($cardsData);
|
||||
|
||||
$summaryDataService = $this->createMock(BookingSummaryDataService::class);
|
||||
$summaryDataService = $this->createMock(BookingSummaryAssembler::class);
|
||||
$summaryDataService->expects($this->once())
|
||||
->method('getSummaryData')
|
||||
->with($bookingDto)
|
||||
->willReturn($summaryData);
|
||||
|
||||
$travelDataService = $this->createMock(TravelDataService::class);
|
||||
$travelDataService = $this->createMock(TravelDataProvider::class);
|
||||
$travelDataService->expects($this->once())
|
||||
->method('getMutabilityData')
|
||||
->with(1234)
|
||||
|
||||
Reference in New Issue
Block a user