feat: groups price calculator admin crud, booking/offer flow and api
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Service;
|
||||
|
||||
use App\Entity\Groups\AccommodationBooking;
|
||||
use App\Repository\Groups\AccommodationPriceRepository;
|
||||
use App\Service\AccommodationBookingBreakdownCalculator;
|
||||
use App\Service\GroupsPriceCalculator;
|
||||
use App\Service\PriceTimelineBuilder;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class AccommodationBookingBreakdownCalculatorTest extends TestCase
|
||||
{
|
||||
public function testComputeReturnsStoredSnapshotWithoutLoadingCurrentPrices(): void
|
||||
{
|
||||
$snapshot = ['total' => 12345, 'currency' => 'EUR'];
|
||||
$booking = new AccommodationBooking();
|
||||
$booking->setPriceSnapshot($snapshot, 12345, 'EUR', 1);
|
||||
|
||||
$priceRepository = $this->createMock(AccommodationPriceRepository::class);
|
||||
$priceRepository->expects(self::never())->method('findByHotelCodeAndDateRange');
|
||||
|
||||
$calculator = new AccommodationBookingBreakdownCalculator(
|
||||
new GroupsPriceCalculator(new PriceTimelineBuilder(), [
|
||||
'runningCostsEur' => 0,
|
||||
'runningCostsChf' => 0,
|
||||
'undersubscription30Eur' => 0,
|
||||
'undersubscription30Chf' => 0,
|
||||
'undersubscription40Eur' => 0,
|
||||
'undersubscription40Chf' => 0,
|
||||
]),
|
||||
$priceRepository,
|
||||
);
|
||||
|
||||
self::assertSame($snapshot, $calculator->compute($booking));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user