From 155a535de9e9846045029064044a304fa8fd04d7 Mon Sep 17 00:00:00 2001 From: Luc Wollants Date: Mon, 25 Nov 2024 14:24:34 +0100 Subject: [PATCH] Update tests to use `BookingAvailability` --- ...CompatiblePayloadSerializerFactoryTest.php | 17 ++++++------- tests/BookingInfoTest.php | 23 ++++++++--------- .../Event/Commands/UpdateBookingInfoTest.php | 13 +++++++--- tests/Event/Events/BookingInfoUpdatedTest.php | 7 ++++-- .../Event/ImportEventRequestHandlerTest.php | 7 ++++-- .../UpdateBookingInfoRequestHandlerTest.php | 13 +++++++--- .../Place/ImportPlaceRequestHandlerTest.php | 7 ++++-- .../Udb3ModelToLegacyOfferAdapterTest.php | 11 +++++--- .../AbstractUpdateBookingInfoTest.php | 13 +++++++--- .../Events/AbstractBookingInfoEventTest.php | 25 +++++++++++++------ tests/OfferLDProjectorTestBase.php | 9 ++++--- 11 files changed, 90 insertions(+), 55 deletions(-) diff --git a/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php b/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php index a6caba2f5e..c6cf147f13 100644 --- a/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php +++ b/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php @@ -401,8 +401,7 @@ public function it_replaces_event_id_with_item_id_on_event_booking_info_updated( /* @var BookingInfoUpdated $bookingInfoUpdated */ $bookingInfoUpdated = $this->serializer->deserialize($decoded); - $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailabilityStarts()); - $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailabilityEnds()); + $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailability()); $this->assertEventIdReplacedWithItemId($sampleFile); } @@ -422,12 +421,12 @@ public function it_replaces_deprecated_availability_date_formats_on_booking_info $this->assertEquals( DateTimeFactory::fromAtom('2018-02-20T15:11:26+00:00'), - $bookingInfoUpdated->getBookingInfo()->getAvailabilityStarts() + $bookingInfoUpdated->getBookingInfo()->getAvailability()->getFrom() ); $this->assertEquals( DateTimeFactory::fromAtom('2018-04-30T14:11:26+00:00'), - $bookingInfoUpdated->getBookingInfo()->getAvailabilityEnds() + $bookingInfoUpdated->getBookingInfo()->getAvailability()->getTo() ); } @@ -444,8 +443,7 @@ public function it_replaces_invalid_availability_date_formats_on_booking_info_up /* @var BookingInfoUpdated $bookingInfoUpdated */ $bookingInfoUpdated = $this->serializer->deserialize($decoded); - $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailabilityStarts()); - $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailabilityEnds()); + $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailability()); } /** @@ -482,12 +480,12 @@ public function it_keeps_valid_availability_date_formats_on_booking_info_updated $this->assertEquals( DateTimeFactory::fromAtom('2018-02-20T15:11:26+01:00'), - $bookingInfoUpdated->getBookingInfo()->getAvailabilityStarts() + $bookingInfoUpdated->getBookingInfo()->getAvailability()->getFrom() ); $this->assertEquals( DateTimeFactory::fromAtom('2018-04-30T14:11:26+01:00'), - $bookingInfoUpdated->getBookingInfo()->getAvailabilityEnds() + $bookingInfoUpdated->getBookingInfo()->getAvailability()->getTo() ); } @@ -504,8 +502,7 @@ public function it_replaces_missing_availability_dates_with_null_on_booking_info /* @var BookingInfoUpdated $bookingInfoUpdated */ $bookingInfoUpdated = $this->serializer->deserialize($decoded); - $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailabilityStarts()); - $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailabilityEnds()); + $this->assertNull($bookingInfoUpdated->getBookingInfo()->getAvailability()); } /** diff --git a/tests/BookingInfoTest.php b/tests/BookingInfoTest.php index a6b294127a..3ec701ffdb 100644 --- a/tests/BookingInfoTest.php +++ b/tests/BookingInfoTest.php @@ -92,8 +92,10 @@ public function it_should_be_creatable_from_a_complete_udb3_model_booking_info() ), new TelephoneNumber('044/444444'), new EmailAddress('info@publiq.be'), - DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2018-01-10T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2018-01-10T00:00:00+01:00') + ) ); $actual = BookingInfo::fromUdb3ModelBookingInfo($udb3ModelBookingInfo); @@ -125,7 +127,6 @@ public function it_should_return_null_for_empty_properties(): void null, null, null, - null, null ); @@ -137,24 +138,21 @@ public function it_should_return_null_for_empty_properties(): void $this->assertNull($bookingInfo->getWebsite()); $this->assertNull($bookingInfo->getPhone()); $this->assertNull($bookingInfo->getEmail()); - $this->assertNull($bookingInfo->getAvailabilityStarts()); - $this->assertNull($bookingInfo->getAvailabilityEnds()); + $this->assertNull($bookingInfo->getAvailability()); $this->assertEquals($expectedSerialized, $bookingInfo->serialize()); $this->assertEquals($expectedJson, $bookingInfo->toJsonLd()); $this->assertNull($bookingInfoWithEmptyString->getWebsite()); $this->assertNull($bookingInfoWithEmptyString->getPhone()); $this->assertNull($bookingInfoWithEmptyString->getEmail()); - $this->assertNull($bookingInfoWithEmptyString->getAvailabilityStarts()); - $this->assertNull($bookingInfoWithEmptyString->getAvailabilityEnds()); + $this->assertNull($bookingInfoWithEmptyString->getAvailability()); $this->assertEquals($expectedSerialized, $bookingInfoWithEmptyString->serialize()); $this->assertEquals($expectedJson, $bookingInfoWithEmptyString->toJsonLd()); $this->assertNull($deserialized->getWebsite()); $this->assertNull($deserialized->getPhone()); $this->assertNull($deserialized->getEmail()); - $this->assertNull($deserialized->getAvailabilityStarts()); - $this->assertNull($deserialized->getAvailabilityEnds()); + $this->assertNull($deserialized->getAvailability()); $this->assertEquals($expectedSerialized, $deserialized->serialize()); $this->assertEquals($expectedJson, $deserialized->toJsonLd()); } @@ -171,7 +169,6 @@ public function it_can_serialize_and_deserialize_partial_booking_info(): void null, $phone, $email, - null, null ); @@ -215,8 +212,10 @@ public function it_ignores_obsolete_properties_when_deserializing(): void ), new TelephoneNumber('044/444444'), new EmailAddress('info@publiq.be'), - DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2018-01-14T23:59:59+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2018-01-14T23:59:59+01:00') + ) ); $actual = BookingInfo::deserialize($data); diff --git a/tests/Event/Commands/UpdateBookingInfoTest.php b/tests/Event/Commands/UpdateBookingInfoTest.php index 9e4c792a2a..a5ccc9ea12 100644 --- a/tests/Event/Commands/UpdateBookingInfoTest.php +++ b/tests/Event/Commands/UpdateBookingInfoTest.php @@ -6,6 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; @@ -33,8 +34,10 @@ public function setUp(): void ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ) ); } @@ -56,8 +59,10 @@ public function it_is_possible_to_instantiate_the_command_with_parameters(): voi ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ) ); diff --git a/tests/Event/Events/BookingInfoUpdatedTest.php b/tests/Event/Events/BookingInfoUpdatedTest.php index db14e53f78..fee1413146 100644 --- a/tests/Event/Events/BookingInfoUpdatedTest.php +++ b/tests/Event/Events/BookingInfoUpdatedTest.php @@ -6,6 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; @@ -72,8 +73,10 @@ public function serializationDataProvider(): array ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ) ), ], diff --git a/tests/Http/Event/ImportEventRequestHandlerTest.php b/tests/Http/Event/ImportEventRequestHandlerTest.php index b702051a51..2fc30b09bd 100644 --- a/tests/Http/Event/ImportEventRequestHandlerTest.php +++ b/tests/Http/Event/ImportEventRequestHandlerTest.php @@ -41,6 +41,7 @@ use CultuurNet\UDB3\Model\Serializer\Event\EventDenormalizer; use CultuurNet\UDB3\Model\ValueObject\Audience\AudienceType; use CultuurNet\UDB3\Model\ValueObject\Calendar\CalendarType; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\ContactPoint; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumbers; @@ -684,8 +685,10 @@ public function it_creates_a_new_event_without_id_but_with_all_properties(): voi ), new TelephoneNumber('016 12 34 56'), new EmailAddress('info@publiq.be'), - new DateTimeImmutable('2021-05-17T22:00:00+00:00'), - new DateTimeImmutable('2021-05-21T22:00:00+00:00') + BookingAvailability::fromTo( + new DateTimeImmutable('2021-05-17T22:00:00+00:00'), + new DateTimeImmutable('2021-05-21T22:00:00+00:00') + ) ) ), new UpdateContactPoint( diff --git a/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php b/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php index 8aac33a35a..419952e5fa 100644 --- a/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php +++ b/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php @@ -14,6 +14,7 @@ use CultuurNet\UDB3\Http\Request\Psr7RequestBuilder; use CultuurNet\UDB3\Http\Response\AssertJsonResponseTrait; use CultuurNet\UDB3\Http\Response\NoContentResponse; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; @@ -109,8 +110,10 @@ public function offerTypeDataProvider(): array ), new TelephoneNumber('02/1232323'), new EmailAddress('info@publiq.be'), - DateTimeFactory::fromAtom('2023-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2028-01-31T23:59:59+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2023-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2028-01-31T23:59:59+01:00') + ) ); $bookingInfoSpecialCharactersUrl = new BookingInfo( @@ -123,8 +126,10 @@ public function offerTypeDataProvider(): array ), new TelephoneNumber('02/1232323'), new EmailAddress('info@publiq.be'), - DateTimeFactory::fromAtom('2023-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2028-01-31T23:59:59+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2023-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2028-01-31T23:59:59+01:00') + ) ); return [ diff --git a/tests/Http/Place/ImportPlaceRequestHandlerTest.php b/tests/Http/Place/ImportPlaceRequestHandlerTest.php index 5d63a220e9..c3d9b835b0 100644 --- a/tests/Http/Place/ImportPlaceRequestHandlerTest.php +++ b/tests/Http/Place/ImportPlaceRequestHandlerTest.php @@ -39,6 +39,7 @@ use CultuurNet\UDB3\Model\ValueObject\Calendar\StatusReason; use CultuurNet\UDB3\Model\ValueObject\Calendar\StatusType; use CultuurNet\UDB3\Model\ValueObject\Calendar\TranslatedStatusReason; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\ContactPoint; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumbers; @@ -872,8 +873,10 @@ public function it_updates_an_existing_place(): void ), new TelephoneNumber('016 10 20 30'), new EmailAddress('booking@dehel.be'), - new DateTimeImmutable('2020-05-17T22:00:00+00:00'), - new DateTimeImmutable('2028-05-17T22:00:00+00:00'), + BookingAvailability::fromTo( + new DateTimeImmutable('2020-05-17T22:00:00+00:00'), + new DateTimeImmutable('2028-05-17T22:00:00+00:00') + ) ) ), new UpdateContactPoint( diff --git a/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php b/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php index 55fdc45dab..9eb4ff8dfa 100644 --- a/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php +++ b/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php @@ -4,6 +4,7 @@ namespace CultuurNet\UDB3\Model\Import\Offer; +use CultuurNet\UDB3\BookingInfo as LegacyBookingInfo; use CultuurNet\UDB3\Calendar\Calendar; use CultuurNet\UDB3\DateTimeFactory; use CultuurNet\UDB3\Event\EventType; @@ -311,7 +312,7 @@ public function it_should_return_price_info_if_there_is_any(): void */ public function it_should_return_empty_booking_info_by_default(): void { - $expected = new \CultuurNet\UDB3\BookingInfo(); + $expected = new LegacyBookingInfo(); $actual = $this->adapter->getBookingInfo(); $this->assertEquals($expected, $actual); } @@ -321,7 +322,7 @@ public function it_should_return_empty_booking_info_by_default(): void */ public function it_should_return_booking_info_if_there_is_any(): void { - $expected = new \CultuurNet\UDB3\BookingInfo( + $expected = new LegacyBookingInfo( new WebsiteLink( new Url('https://www.publiq.be'), new TranslatedWebsiteLabel( @@ -331,8 +332,10 @@ public function it_should_return_booking_info_if_there_is_any(): void ), new TelephoneNumber('044/444444'), new EmailAddress('info@publiq.be'), - new DateTimeImmutable('2018-01-01T10:00:00+01:00'), - new DateTimeImmutable('2018-01-10T10:00:00+01:00') + BookingAvailability::fromTo( + new DateTimeImmutable('2018-01-01T10:00:00+01:00'), + new DateTimeImmutable('2018-01-10T10:00:00+01:00') + ) ); $actual = $this->completeAdapter->getBookingInfo(); $this->assertEquals($expected, $actual); diff --git a/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php b/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php index 63a010f674..15d25588c1 100644 --- a/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php +++ b/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php @@ -6,6 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; @@ -40,8 +41,10 @@ public function setUp(): void ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ); $this->updateBookingInfo = $this->getMockForAbstractClass( @@ -66,8 +69,10 @@ public function it_can_return_its_properties(): void ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ); $this->assertEquals($expectedBookingInfo, $bookingInfo); diff --git a/tests/Offer/Events/AbstractBookingInfoEventTest.php b/tests/Offer/Events/AbstractBookingInfoEventTest.php index 1e4915f900..6ff2bcaa9f 100644 --- a/tests/Offer/Events/AbstractBookingInfoEventTest.php +++ b/tests/Offer/Events/AbstractBookingInfoEventTest.php @@ -6,6 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; @@ -39,8 +40,10 @@ public function setUp(): void ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ); $this->abstractBookingInfoEvent = new MockAbstractBookingInfoEvent( $this->itemId, @@ -64,8 +67,10 @@ public function it_can_be_instantiated_with_properties(): void ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ); $expectedAbstractBookingInfoEvent = new MockAbstractBookingInfoEvent( $expectedItemId, @@ -91,8 +96,10 @@ public function it_can_return_its_properties(): void ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ); $itemId = $this->abstractBookingInfoEvent->getItemId(); @@ -157,8 +164,10 @@ public function serializationDataProvider(): array ), new TelephoneNumber('0123456789'), new EmailAddress('foo@bar.com'), - DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), - DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2016-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2016-01-31T00:00:00+01:00') + ) ) ), ], diff --git a/tests/OfferLDProjectorTestBase.php b/tests/OfferLDProjectorTestBase.php index fbd7c15dca..04114d62b1 100644 --- a/tests/OfferLDProjectorTestBase.php +++ b/tests/OfferLDProjectorTestBase.php @@ -12,6 +12,7 @@ use CultuurNet\UDB3\Media\Properties\Description as MediaDescription; use CultuurNet\UDB3\Media\Properties\MIMEType; use CultuurNet\UDB3\Model\ValueObject\Audience\Age; +use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\ContactPoint as Udb3ContactPoint; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumbers; @@ -124,9 +125,11 @@ public function it_projects_the_updating_of_booking_info(): void ); $phone = new TelephoneNumber('045'); $email = new EmailAddress('test@test.com'); - $availabilityStarts = DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'); - $availabilityEnds = DateTimeFactory::fromAtom('2018-01-31T00:00:00+01:00'); - $bookingInfo = new BookingInfo($websiteLink, $phone, $email, $availabilityStarts, $availabilityEnds); + $bookingAvailability = BookingAvailability::fromTo( + DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'), + DateTimeFactory::fromAtom('2018-01-31T00:00:00+01:00') + ); + $bookingInfo = new BookingInfo($websiteLink, $phone, $email, $bookingAvailability); $eventClass = $this->getEventClass('BookingInfoUpdated'); $bookingInfoUpdated = new $eventClass($id, $bookingInfo);