From c606b9c7da47fe37693bd046b4f3e0247e667665 Mon Sep 17 00:00:00 2001 From: Luc Wollants Date: Thu, 7 Nov 2024 16:07:27 +0100 Subject: [PATCH 1/4] Refactor `MultilingualString` to use new `Language` model --- src/ValueObject/MultilingualString.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ValueObject/MultilingualString.php b/src/ValueObject/MultilingualString.php index d1888d0305..1124ba2015 100644 --- a/src/ValueObject/MultilingualString.php +++ b/src/ValueObject/MultilingualString.php @@ -4,7 +4,7 @@ namespace CultuurNet\UDB3\ValueObject; -use CultuurNet\UDB3\Language; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Translation\TranslatedValueObject; /** @@ -136,7 +136,7 @@ public static function fromUdb3ModelTranslatedValueObject(TranslatedValueObject } $string = new MultilingualString( - Language::fromUdb3ModelLanguage($originalLanguage), + $originalLanguage, $originalValue->toString() ); From bb4a6c7decccf6cf18c3573af075d5a12efa839d Mon Sep 17 00:00:00 2001 From: Luc Wollants Date: Thu, 7 Nov 2024 16:07:46 +0100 Subject: [PATCH 2/4] Refactor code --- src/Cdb/CdbXmlPriceInfoParser.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Cdb/CdbXmlPriceInfoParser.php b/src/Cdb/CdbXmlPriceInfoParser.php index 9d838a9e9e..350f509a0f 100644 --- a/src/Cdb/CdbXmlPriceInfoParser.php +++ b/src/Cdb/CdbXmlPriceInfoParser.php @@ -6,7 +6,6 @@ use CultureFeed_Cdb_Data_Detail; use CultureFeed_Cdb_Data_Price; -use CultuurNet\UDB3\Language as LegacyLanguage; use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\MoneyFactory; use CultuurNet\UDB3\PriceInfo\BasePrice; @@ -101,13 +100,13 @@ function (\CultureFeed_Cdb_Data_Detail $detail) use ($mainLanguage) { foreach ($translatedTariffs as $tariffName => $tariffPrice) { if (!isset($tariffs[$tariffIndex])) { $tariff = new Tariff( - new MultilingualString(new LegacyLanguage($language), (string) $tariffName), + new MultilingualString(new Language($language), (string) $tariffName), MoneyFactory::create($tariffPrice, new Currency('EUR')) ); } else { $tariff = $tariffs[$tariffIndex]; $name = $tariff->getName(); - $name = $name->withTranslation(new LegacyLanguage($language), (string) $tariffName); + $name = $name->withTranslation(new Language($language), (string) $tariffName); $tariff = new Tariff( $name, $tariff->getPrice() From 38d30526a7a1fba8cc1f246a1baa809f936aee37 Mon Sep 17 00:00:00 2001 From: Luc Wollants Date: Thu, 7 Nov 2024 16:08:06 +0100 Subject: [PATCH 3/4] Refactor tests --- ...CompatiblePayloadSerializerFactoryTest.php | 7 ++-- tests/BookingInfoTest.php | 13 ++++---- .../Event/Commands/UpdateBookingInfoTest.php | 2 +- tests/Event/EventTest.php | 32 +++++++++---------- tests/Event/Events/BookingInfoUpdatedTest.php | 2 +- .../Event/ImportEventRequestHandlerTest.php | 5 ++- .../UpdateBookingInfoRequestHandlerTest.php | 2 +- .../Place/ImportPlaceRequestHandlerTest.php | 3 +- .../Udb3ModelToLegacyOfferAdapterTest.php | 4 +-- .../AbstractUpdateBookingInfoTest.php | 2 +- .../Events/AbstractBookingInfoEventTest.php | 2 +- tests/Offer/OfferTest.php | 6 ++-- .../ReadModel/JSONLD/OfferLDProjectorTest.php | 7 ++-- tests/OfferLDProjectorTestBase.php | 3 +- tests/Place/PlaceTest.php | 2 +- tests/PriceInfo/PriceInfoTest.php | 2 +- tests/ValueObject/MultilingualStringTest.php | 2 +- 17 files changed, 46 insertions(+), 50 deletions(-) diff --git a/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php b/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php index 4fb4c7bbbd..8c4439da04 100644 --- a/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php +++ b/tests/BackwardsCompatiblePayloadSerializerFactoryTest.php @@ -6,7 +6,6 @@ use Broadway\Serializer\Serializer; use CultuurNet\UDB3\Event\Events\ContactPointUpdated; -use CultuurNet\UDB3\Language as LegacyLanguage; use CultuurNet\UDB3\Event\Events\BookingInfoUpdated; use CultuurNet\UDB3\Event\Events\DescriptionTranslated; use CultuurNet\UDB3\Event\Events\EventCreated; @@ -455,7 +454,7 @@ public function it_replaces_deprecated_url_label_on_booking_info_updated(): void $bookingInfoUpdated = $this->serializer->deserialize($decoded); $this->assertEquals( - new MultilingualString(new LegacyLanguage('nl'), 'Reserveer plaatsen'), + new MultilingualString(new Language('nl'), 'Reserveer plaatsen'), $bookingInfoUpdated->getBookingInfo()->getUrlLabel() ); } @@ -625,7 +624,7 @@ public function it_should_replace_string_names_with_translatable_objects_in_pric ->withExtraTariff( new Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Senioren' ), new Money(1000, new Currency('EUR')) @@ -634,7 +633,7 @@ public function it_should_replace_string_names_with_translatable_objects_in_pric ->withExtraTariff( new Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Studenten' ), new Money(750, new Currency('EUR')) diff --git a/tests/BookingInfoTest.php b/tests/BookingInfoTest.php index c42988f192..9f0edf5056 100644 --- a/tests/BookingInfoTest.php +++ b/tests/BookingInfoTest.php @@ -6,6 +6,7 @@ use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language as Udb3ModelLanguage; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; use CultuurNet\UDB3\Model\ValueObject\Web\TranslatedWebsiteLabel; use CultuurNet\UDB3\Model\ValueObject\Web\Url; @@ -24,7 +25,7 @@ public function it_can_compare(): void $bookingInfo = new BookingInfo( 'www.publiq.be', new MultilingualString( - new Language('nl'), + new Udb3ModelLanguage('nl'), 'publiq' ), '02 123 45 67', @@ -34,7 +35,7 @@ public function it_can_compare(): void $sameBookingInfo = new BookingInfo( 'www.publiq.be', new MultilingualString( - new Language('nl'), + new Udb3ModelLanguage('nl'), 'publiq' ), '02 123 45 67', @@ -44,7 +45,7 @@ public function it_can_compare(): void $otherBookingInfo = new BookingInfo( 'www.2dotstwice.be', new MultilingualString( - new Language('nl'), + new Udb3ModelLanguage('nl'), '2dotstwice' ), '016 12 34 56', @@ -64,7 +65,7 @@ public function it_should_be_creatable_from_a_complete_udb3_model_booking_info() new WebsiteLink( new Url('https://publiq.be'), new TranslatedWebsiteLabel( - new \CultuurNet\UDB3\Model\ValueObject\Translation\Language('nl'), + new Udb3ModelLanguage('nl'), new WebsiteLabel('publiq') ) ), @@ -79,7 +80,7 @@ public function it_should_be_creatable_from_a_complete_udb3_model_booking_info() $expected = new BookingInfo( 'https://publiq.be', new MultilingualString( - new Language('nl'), + new Udb3ModelLanguage('nl'), 'publiq' ), '044/444444', @@ -205,7 +206,7 @@ public function it_ignores_obsolete_properties_when_deserializing(): void $expected = new BookingInfo( 'https://www.publiq.be', new MultilingualString( - new Language('nl'), + new Udb3ModelLanguage('nl'), 'publiq' ), '044/444444', diff --git a/tests/Event/Commands/UpdateBookingInfoTest.php b/tests/Event/Commands/UpdateBookingInfoTest.php index 7e7060fd14..7ba5ab004e 100644 --- a/tests/Event/Commands/UpdateBookingInfoTest.php +++ b/tests/Event/Commands/UpdateBookingInfoTest.php @@ -6,7 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; -use CultuurNet\UDB3\Language; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\ValueObject\MultilingualString; use PHPUnit\Framework\TestCase; diff --git a/tests/Event/EventTest.php b/tests/Event/EventTest.php index 964604fa80..1474b25135 100644 --- a/tests/Event/EventTest.php +++ b/tests/Event/EventTest.php @@ -609,7 +609,7 @@ public function it_handles_update_booking_info_after_udb2_update(): void $bookingInfo = new BookingInfo( 'www.publiq.be', - new MultilingualString(new LegacyLanguage('nl'), 'publiq'), + new MultilingualString(new Language('nl'), 'publiq'), '02 123 45 67', 'info@publiq.be' ); @@ -661,7 +661,7 @@ public function it_keeps_existing_uitpas_prices_on_price_info_update(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -691,7 +691,7 @@ public function it_keeps_existing_uitpas_prices_on_price_info_update(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -729,7 +729,7 @@ public function it_ignores_an_update_of_uitpas_prices(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -752,7 +752,7 @@ public function it_ignores_an_update_of_uitpas_prices(): void ))->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -770,7 +770,7 @@ public function it_ignores_an_update_of_uitpas_prices(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -808,7 +808,7 @@ public function it_ignores_an_update_with_equal_prices_without_uitpas(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -859,7 +859,7 @@ public function it_ignores_an_update_with_only_different_uitpas_prices(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -883,7 +883,7 @@ public function it_ignores_an_update_with_only_different_uitpas_prices(): void )->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -951,7 +951,7 @@ public function it_handles_update_price_info_from_udb2_update(): void ->withTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Met kinderen' ), new Money(2000, new Currency('EUR')) @@ -965,7 +965,7 @@ public function it_handles_update_price_info_from_udb2_update(): void ->withTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Met kinderen' ), new Money(1499, new Currency('EUR')) @@ -980,7 +980,7 @@ public function it_handles_update_price_info_from_udb2_update(): void ->withTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Met kinderen' ), new Money(1499, new Currency('EUR')) @@ -1926,7 +1926,7 @@ public function it_ignores_equal_uitpas_prices(): void ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -1936,7 +1936,7 @@ public function it_ignores_equal_uitpas_prices(): void ), new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 2' ), new Money( @@ -2027,7 +2027,7 @@ function (Event $event): void { ->withUiTPASTariffs([ new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 1' ), new Money( @@ -2037,7 +2037,7 @@ function (Event $event): void { ), new \CultuurNet\UDB3\PriceInfo\Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tariff 2' ), new Money( diff --git a/tests/Event/Events/BookingInfoUpdatedTest.php b/tests/Event/Events/BookingInfoUpdatedTest.php index 798c51f6fb..5a79ced45d 100644 --- a/tests/Event/Events/BookingInfoUpdatedTest.php +++ b/tests/Event/Events/BookingInfoUpdatedTest.php @@ -6,7 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; -use CultuurNet\UDB3\Language; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\ValueObject\MultilingualString; use PHPUnit\Framework\TestCase; diff --git a/tests/Http/Event/ImportEventRequestHandlerTest.php b/tests/Http/Event/ImportEventRequestHandlerTest.php index 49055e7dcf..997e377979 100644 --- a/tests/Http/Event/ImportEventRequestHandlerTest.php +++ b/tests/Http/Event/ImportEventRequestHandlerTest.php @@ -33,7 +33,6 @@ use CultuurNet\UDB3\Http\Request\Psr7RequestBuilder; use CultuurNet\UDB3\Iri\CallableIriGenerator; use CultuurNet\UDB3\Json; -use CultuurNet\UDB3\Language as LegacyLanguage; use CultuurNet\UDB3\Media\Image; use CultuurNet\UDB3\Media\ImageCollection; use CultuurNet\UDB3\Media\Properties\Description as MediaDescription; @@ -672,8 +671,8 @@ public function it_creates_a_new_event_without_id_but_with_all_properties(): voi $eventId, new BookingInfo( 'https://www.publiq.be', - (new MultilingualString(new LegacyLanguage('nl'), 'Nederlandse label')) - ->withTranslation(new LegacyLanguage('en'), 'English label'), + (new MultilingualString(new Language('nl'), 'Nederlandse label')) + ->withTranslation(new Language('en'), 'English label'), '016 12 34 56', 'info@publiq.be', new DateTimeImmutable('2021-05-17T22:00:00+00:00'), diff --git a/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php b/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php index 81b6525694..afdb26033d 100644 --- a/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php +++ b/tests/Http/Offer/UpdateBookingInfoRequestHandlerTest.php @@ -14,7 +14,7 @@ use CultuurNet\UDB3\Http\Request\Psr7RequestBuilder; use CultuurNet\UDB3\Http\Response\AssertJsonResponseTrait; use CultuurNet\UDB3\Http\Response\NoContentResponse; -use CultuurNet\UDB3\Language; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Offer\Commands\AbstractUpdateBookingInfo; use CultuurNet\UDB3\Place\Commands\UpdateBookingInfo as PlaceUpdateBookingInfo; use CultuurNet\UDB3\ValueObject\MultilingualString; diff --git a/tests/Http/Place/ImportPlaceRequestHandlerTest.php b/tests/Http/Place/ImportPlaceRequestHandlerTest.php index 19e8f98e01..017f782ce3 100644 --- a/tests/Http/Place/ImportPlaceRequestHandlerTest.php +++ b/tests/Http/Place/ImportPlaceRequestHandlerTest.php @@ -25,7 +25,6 @@ use CultuurNet\UDB3\Http\Response\JsonResponse; use CultuurNet\UDB3\Iri\CallableIriGenerator; use CultuurNet\UDB3\Json; -use CultuurNet\UDB3\Language as LegacyLanguage; use CultuurNet\UDB3\Media\Image; use CultuurNet\UDB3\Media\ImageCollection; use CultuurNet\UDB3\Media\Properties\Description; @@ -864,7 +863,7 @@ public function it_updates_an_existing_place(): void new BookingInfo( 'https://www.dehel.be/booking', new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Bestel hier je tickets' ), '016 10 20 30', diff --git a/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php b/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php index a6d940f9d1..ef03019277 100644 --- a/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php +++ b/tests/Model/Import/Offer/Udb3ModelToLegacyOfferAdapterTest.php @@ -300,7 +300,7 @@ public function it_should_return_price_info_if_there_is_any(): void ); $expected = $expected->withExtraTariff( new \CultuurNet\UDB3\PriceInfo\Tariff( - new MultilingualString(new \CultuurNet\UDB3\Language('nl'), 'Senioren'), + new MultilingualString(new Language('nl'), 'Senioren'), new Money(1050, new Currency('EUR')) ) ); @@ -326,7 +326,7 @@ public function it_should_return_booking_info_if_there_is_any(): void $expected = new \CultuurNet\UDB3\BookingInfo( 'https://www.publiq.be', new MultilingualString( - new \CultuurNet\UDB3\Language('nl'), + new Language('nl'), 'Publiq' ), '044/444444', diff --git a/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php b/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php index 0f33fb05a4..b6b033b461 100644 --- a/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php +++ b/tests/Offer/Commands/AbstractUpdateBookingInfoTest.php @@ -6,7 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; -use CultuurNet\UDB3\Language; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\ValueObject\MultilingualString; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; diff --git a/tests/Offer/Events/AbstractBookingInfoEventTest.php b/tests/Offer/Events/AbstractBookingInfoEventTest.php index dcacacb9d5..a3df46b63e 100644 --- a/tests/Offer/Events/AbstractBookingInfoEventTest.php +++ b/tests/Offer/Events/AbstractBookingInfoEventTest.php @@ -6,7 +6,7 @@ use CultuurNet\UDB3\BookingInfo; use CultuurNet\UDB3\DateTimeFactory; -use CultuurNet\UDB3\Language; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\ValueObject\MultilingualString; use PHPUnit\Framework\TestCase; diff --git a/tests/Offer/OfferTest.php b/tests/Offer/OfferTest.php index e0d85d7315..328f8f663e 100644 --- a/tests/Offer/OfferTest.php +++ b/tests/Offer/OfferTest.php @@ -2013,21 +2013,21 @@ public function it_handles_booking_info_updated_events(): void $bookingInfo = new BookingInfo( 'www.publiq.be', - new MultilingualString(new LegacyLanguage('nl'), 'publiq'), + new MultilingualString(new Language('nl'), 'publiq'), '02 123 45 67', 'info@publiq.be' ); $sameBookingInfo = new BookingInfo( 'www.publiq.be', - new MultilingualString(new LegacyLanguage('nl'), 'publiq'), + new MultilingualString(new Language('nl'), 'publiq'), '02 123 45 67', 'info@publiq.be' ); $otherBookingInfo = new BookingInfo( 'www.2dotstwice.be', - new MultilingualString(new LegacyLanguage('nl'), '2dotstwice'), + new MultilingualString(new Language('nl'), '2dotstwice'), '016 12 34 56', 'info@2dotstwice.be' ); diff --git a/tests/Offer/ReadModel/JSONLD/OfferLDProjectorTest.php b/tests/Offer/ReadModel/JSONLD/OfferLDProjectorTest.php index 6ae01e7497..f6fde5f3e9 100644 --- a/tests/Offer/ReadModel/JSONLD/OfferLDProjectorTest.php +++ b/tests/Offer/ReadModel/JSONLD/OfferLDProjectorTest.php @@ -15,7 +15,6 @@ use CultuurNet\UDB3\Facility; use CultuurNet\UDB3\Iri\CallableIriGenerator; use CultuurNet\UDB3\Json; -use CultuurNet\UDB3\Language as LegacyLanguage; use CultuurNet\UDB3\Media\Image; use CultuurNet\UDB3\Media\ImageCollection; use CultuurNet\UDB3\Media\Properties\Description as MediaDescription; @@ -763,7 +762,7 @@ public function it_projects_the_updated_price_info(): void $priceInfo = $priceInfo->withExtraTariff( new Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'Tarief inwoners' ), new Money(950, new Currency('EUR')) @@ -773,7 +772,7 @@ public function it_projects_the_updated_price_info(): void $priceInfo = $priceInfo->withExtraUiTPASTariff( new Tariff( new MultilingualString( - new LegacyLanguage('nl'), + new Language('nl'), 'UiTPAS tarief' ), new Money(650, new Currency('EUR')) @@ -2468,7 +2467,7 @@ public function it_should_update_bookinginfo(): void $event = new BookingInfoUpdated($id, new BookingInfo( 'http://www.google.be', - new MultilingualString(new LegacyLanguage('nl'), 'Dit is een booking info event'), + new MultilingualString(new Language('nl'), 'Dit is een booking info event'), '0471123456', 'test@test.be' )); diff --git a/tests/OfferLDProjectorTestBase.php b/tests/OfferLDProjectorTestBase.php index a104accfcb..f65c49070d 100644 --- a/tests/OfferLDProjectorTestBase.php +++ b/tests/OfferLDProjectorTestBase.php @@ -7,7 +7,6 @@ use Broadway\Domain\DateTime; use Broadway\Domain\DomainMessage; use Broadway\Domain\Metadata; -use CultuurNet\UDB3\Language as LegacyLanguage; use Broadway\EventHandling\EventListener; use CultuurNet\UDB3\Media\Image; use CultuurNet\UDB3\Media\Properties\Description as MediaDescription; @@ -115,7 +114,7 @@ public function it_projects_the_updating_of_booking_info(): void { $id = 'foo'; $url = 'http://www.google.be'; - $urlLabel = new MultilingualString(new LegacyLanguage('nl'), 'Google'); + $urlLabel = new MultilingualString(new Language('nl'), 'Google'); $phone = '045'; $email = 'test@test.com'; $availabilityStarts = DateTimeFactory::fromAtom('2018-01-01T00:00:00+01:00'); diff --git a/tests/Place/PlaceTest.php b/tests/Place/PlaceTest.php index ebdbfe9334..d458ffaf7b 100644 --- a/tests/Place/PlaceTest.php +++ b/tests/Place/PlaceTest.php @@ -403,7 +403,7 @@ public function it_handles_update_booking_info_after_udb2_import(): void $bookingInfo = new BookingInfo( 'www.publiq.be', - new MultilingualString(new LegacyLanguage('nl'), 'Publiq'), + new MultilingualString(new Language('nl'), 'Publiq'), '02 123 45 67', 'info@publiq.be' ); diff --git a/tests/PriceInfo/PriceInfoTest.php b/tests/PriceInfo/PriceInfoTest.php index a217afd7d1..c61c1e9531 100644 --- a/tests/PriceInfo/PriceInfoTest.php +++ b/tests/PriceInfo/PriceInfoTest.php @@ -4,10 +4,10 @@ namespace CultuurNet\UDB3\PriceInfo; -use CultuurNet\UDB3\Language; use CultuurNet\UDB3\Model\ValueObject\Price\TariffName; use CultuurNet\UDB3\Model\ValueObject\Price\Tariffs; use CultuurNet\UDB3\Model\ValueObject\Price\TranslatedTariffName; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\ValueObject\MultilingualString; use Money\Currency; use Money\Money; diff --git a/tests/ValueObject/MultilingualStringTest.php b/tests/ValueObject/MultilingualStringTest.php index ddf346d707..f88ceb3c1c 100644 --- a/tests/ValueObject/MultilingualStringTest.php +++ b/tests/ValueObject/MultilingualStringTest.php @@ -4,7 +4,6 @@ namespace CultuurNet\UDB3\ValueObject; -use CultuurNet\UDB3\Language; use CultuurNet\UDB3\Model\ValueObject\Geography\Address; use CultuurNet\UDB3\Model\ValueObject\Geography\CountryCode; use CultuurNet\UDB3\Model\ValueObject\Geography\Locality; @@ -13,6 +12,7 @@ use CultuurNet\UDB3\Model\ValueObject\Geography\TranslatedAddress; use CultuurNet\UDB3\Model\ValueObject\Price\TariffName; use CultuurNet\UDB3\Model\ValueObject\Price\TranslatedTariffName; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use PHPUnit\Framework\TestCase; class MultilingualStringTest extends TestCase From bcb46ffcfc8665bdd6d0f520fc8a102c87130531 Mon Sep 17 00:00:00 2001 From: Luc Wollants Date: Fri, 8 Nov 2024 18:54:43 +0100 Subject: [PATCH 4/4] Remove alias `Udb3ModelLanguage` --- tests/BookingInfoTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/BookingInfoTest.php b/tests/BookingInfoTest.php index 9f0edf5056..6310bd3cb0 100644 --- a/tests/BookingInfoTest.php +++ b/tests/BookingInfoTest.php @@ -6,7 +6,7 @@ use CultuurNet\UDB3\Model\ValueObject\Contact\BookingAvailability; use CultuurNet\UDB3\Model\ValueObject\Contact\TelephoneNumber; -use CultuurNet\UDB3\Model\ValueObject\Translation\Language as Udb3ModelLanguage; +use CultuurNet\UDB3\Model\ValueObject\Translation\Language; use CultuurNet\UDB3\Model\ValueObject\Web\EmailAddress; use CultuurNet\UDB3\Model\ValueObject\Web\TranslatedWebsiteLabel; use CultuurNet\UDB3\Model\ValueObject\Web\Url; @@ -25,7 +25,7 @@ public function it_can_compare(): void $bookingInfo = new BookingInfo( 'www.publiq.be', new MultilingualString( - new Udb3ModelLanguage('nl'), + new Language('nl'), 'publiq' ), '02 123 45 67', @@ -35,7 +35,7 @@ public function it_can_compare(): void $sameBookingInfo = new BookingInfo( 'www.publiq.be', new MultilingualString( - new Udb3ModelLanguage('nl'), + new Language('nl'), 'publiq' ), '02 123 45 67', @@ -45,7 +45,7 @@ public function it_can_compare(): void $otherBookingInfo = new BookingInfo( 'www.2dotstwice.be', new MultilingualString( - new Udb3ModelLanguage('nl'), + new Language('nl'), '2dotstwice' ), '016 12 34 56', @@ -65,7 +65,7 @@ public function it_should_be_creatable_from_a_complete_udb3_model_booking_info() new WebsiteLink( new Url('https://publiq.be'), new TranslatedWebsiteLabel( - new Udb3ModelLanguage('nl'), + new Language('nl'), new WebsiteLabel('publiq') ) ), @@ -80,7 +80,7 @@ public function it_should_be_creatable_from_a_complete_udb3_model_booking_info() $expected = new BookingInfo( 'https://publiq.be', new MultilingualString( - new Udb3ModelLanguage('nl'), + new Language('nl'), 'publiq' ), '044/444444', @@ -206,7 +206,7 @@ public function it_ignores_obsolete_properties_when_deserializing(): void $expected = new BookingInfo( 'https://www.publiq.be', new MultilingualString( - new Udb3ModelLanguage('nl'), + new Language('nl'), 'publiq' ), '044/444444',