/**
  *
  */
 public function testCreatingWorkingDayAndRetrievingItReturnsSame()
 {
     $this->repo->add($this->workingDayWithTask);
     $workingDayFromRepo = $this->repo->getByDate(Carbon::now());
     $this->assertEquals($workingDayFromRepo->getDate(), $this->workingDayWithTask->getDate());
     $this->repo->remove($this->workingDayWithTask);
 }
예제 #2
0
 public function testICanAddATaskFromCommand()
 {
     $command = new AddTask("Task test");
     $this->commandHandler->handle($command);
     $workingDayFromRepo = $this->workingDayRepo->getByDate(Carbon::now());
     $expectedWorkingDay = new WorkingDay(WorkingDayId::generate());
     $expectedWorkingDay->addTask(new Task("Task test"));
     $this->assertEquals($expectedWorkingDay->getDate(), $workingDayFromRepo->getDate());
 }
 public function add(WorkingDay $workingDay)
 {
     $this->workingDays[$workingDay->getDate()] = $workingDay;
 }
 /**
  * Renders the body of the email.
  *
  * @param WorkingDay $day
  * @return string The subject.
  */
 public function renderSubject(WorkingDay $day)
 {
     return "Tasks for " . $day->getDate();
 }
예제 #5
0
 /**
  * Renders the body of the email.
  *
  * @param WorkingDay $day
  * @return string The subject.
  */
 public function renderSubject(WorkingDay $day)
 {
     $format = str_replace('#date#', '%s', $this->templateSubject);
     return sprintf($format, $day->getDate());
 }
예제 #6
0
 public function testTheIdOfAWorkingDayIsRelatedToItsDateOfCreation()
 {
     $this->assertEquals(Carbon::now('Europe/Madrid')->toDateString(), $this->workingDay->getDate());
 }