ImportSchedule: Append talk language to shift title

Resolves #587 (Include talk language into Frab-imported shift titles)
This commit is contained in:
Igor Scheller 2019-11-30 01:15:39 +01:00
parent 42721e9572
commit 47e209e125
3 changed files with 13 additions and 0 deletions

View File

@ -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()));
}
}
}

View File

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

View File

@ -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());
}
}