fix: allow hotel-less travel data
addresses #869ckkwh7
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\BusProNet\XmlLoader;
|
||||
|
||||
use App\BusProNet\Model\Travel;
|
||||
use App\BusProNet\XmlLoader\HotelLoader;
|
||||
use League\Flysystem\FilesystemOperator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
||||
|
||||
class HotelLoaderTest extends TestCase
|
||||
{
|
||||
public function testPatchHotelDetailsSkipsWhenTravelHasNoHotelId(): void
|
||||
{
|
||||
$filesystem = $this->createMock(FilesystemOperator::class);
|
||||
$filesystem
|
||||
->expects($this->never())
|
||||
->method('read');
|
||||
|
||||
$loader = new HotelLoader(new ArrayAdapter(), $filesystem);
|
||||
$travel = new Travel();
|
||||
$travel->hotelId = null;
|
||||
$travel->hotel = null;
|
||||
|
||||
$loader->patchHotelDetails($travel);
|
||||
|
||||
$this->assertNull($travel->hotel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user