ImportSchedule: Append talk language to shift title

Resolves #587 (Include talk language into Frab-imported shift titles)
main
Igor Scheller 5 years ago
parent 42721e9572
commit 47e209e125

@ -440,6 +440,7 @@ class ImportSchedule extends BaseController
$event->getDate()->subMinutes($minutesBefore);
$event->getEndDate()->addMinutes($minutesAfter);
$event->setTitle(sprintf('%s [%s]', $event->getTitle(), $event->getLanguage()));
}
}
}

@ -183,6 +183,14 @@ class Event
return $this->title;
}
/**
* @param string $title
*/
public function setTitle(string $title): void
{
$this->title = $title;
}
/**
* @return string
*/

@ -84,6 +84,7 @@ class EventTest extends TestCase
* @covers \Engelsystem\Helpers\Schedule\Event::getId
* @covers \Engelsystem\Helpers\Schedule\Event::getRoom
* @covers \Engelsystem\Helpers\Schedule\Event::getTitle
* @covers \Engelsystem\Helpers\Schedule\Event::setTitle
* @covers \Engelsystem\Helpers\Schedule\Event::getSubtitle
* @covers \Engelsystem\Helpers\Schedule\Event::getType
* @covers \Engelsystem\Helpers\Schedule\Event::getDate
@ -141,5 +142,8 @@ class EventTest extends TestCase
$this->assertEquals($attachments, $event->getAttachments());
$this->assertEquals('https://foo.bar/2-lorem', $event->getUrl());
$this->assertEquals('https://videos.orem.ipsum/2-lorem.mp4', $event->getVideoDownloadUrl());
$event->setTitle('Event title');
$this->assertEquals('Event title', $event->getTitle());
}
}

Loading…
Cancel
Save