public function __construct(ActivityId $id, $name, $description, Schedule $schedule, Location $location, $category) { parent::__construct($id); $this->name = $name; $this->description = $description; $this->location = $location; $this->category = $category; $this->startTime = $schedule->startTime(); $this->endTime = $schedule->endTime(); $this->schedule = $schedule; }
protected function createInstance() { return new ActivityRescheduled(ActivityId::generate(), Schedule::forPeriod(new DateTimeImmutable('2015-10-03 14:30'), new DateTimeImmutable('2015-10-03 15:30'))); }
/** * Creates an ActivityPlanned event given an id and some options. * The options array can override the given default values. */ private function socialActivityWasPlanned(ActivityId $id, array $options = []) : ActivityPlanned { $options = array_merge(['schedule' => Schedule::withStartTime(new DateTimeImmutable('2015-10-01 14:30')), 'category' => Activity::SOCIAL], $options); return new ActivityPlanned($id, 'Crash & Compile', 'Programming competition', $options['schedule'], Location::fromNameAndAddress('Francken kamer'), $options['category']); }
protected function createInstance() { return new ActivityPlanned(ActivityId::generate(), 'Crash & Compile', 'Programming competition', Schedule::withStartTime(new DateTimeImmutable('2015-10-01 14:30')), Location::fromNameAndAddress('Francken kamer'), Activity::SOCIAL); }
/** * @test */ public function the_end_time_and_the_start_time_cant_be_identical() { $this->expectException(InvalidArgumentException::class); $time = new DateTimeImmutable('2015-03-10 10:00'); $schedule = Schedule::forPeriod($time, $time); }