/** * Sets shared calendar color. * @param SavedCalendarSubscription $sharedCalendar */ public static function setSharedCalendarColor(SavedCalendarSubscription $sharedCalendar) { if ($sharedCalendar->color == null) { $usedColors = CalendarUtil::getAlreadyUsedColorsByUser(Yii::app()->user->userModel); self::processAndSaveColor($sharedCalendar, $usedColors); } }
public function testGetUsedCalendarColorsByUser() { $colors = CalendarUtil::getAlreadyUsedColorsByUser(Yii::app()->user->userModel); $this->assertContains('#66367b', $colors); $this->assertContains('#315AB0', $colors); }