/** * @test */ public function it_returns_the_correct_property_values() { $expectedId = 'someid'; $expectedLanguage = 'fr'; $expectedTitle = 'Title'; $expectedShortDescription = 'Short description'; $expectedLongDescription = 'Long long long extra long description'; $applyTranslation = new ApplyTranslation(new String('someid'), new Language('fr'), new String('Title'), new String('Short description'), new String('Long long long extra long description')); $this->assertEquals($expectedId, $applyTranslation->getEventId()); $this->assertEquals($expectedLanguage, $applyTranslation->getLanguage()); $this->assertEquals($expectedTitle, $applyTranslation->getTitle()); $this->assertEquals($expectedShortDescription, $applyTranslation->getShortDescription()); $this->assertEquals($expectedLongDescription, $applyTranslation->getLongDescription()); }
/** * @param ApplyTranslation $applyTranslation */ public function handleApplyTranslation(ApplyTranslation $applyTranslation) { /** @var Event $event */ $event = $this->eventRepository->load($applyTranslation->getEventId()->toNative()); $event->applyTranslation($applyTranslation->getLanguage(), $applyTranslation->getTitle(), $applyTranslation->getShortDescription(), $applyTranslation->getLongDescription()); $this->eventRepository->save($event); }