/** @test */ public function an_activity_can_be_planned() { $id = ActivityId::generate(); $this->scenario->when(function () use($id) { return Activity::plan($id, 'Crash & Compile', 'Programming competition', Schedule::withStartTime(new DateTimeImmutable('2015-10-01 14:30')), Location::fromNameAndAddress('Francken kamer'), Activity::SOCIAL); })->then([$this->socialActivityWasPlanned($id)]); }
public static function plan(ActivityId $id, $name, $description, Schedule $schedule, Location $location, $type) { $activity = new Activity(); $activity->apply(new ActivityPlanned($id, $name, $description, $schedule, $location, $type)); return $activity; }