Exemplo n.º 1
0
 /**
  * Request a new password reminder
  *
  * @param string $email
  * @return Reminder
  */
 public function sendCode($email)
 {
     $this->validate($email);
     $reminder = $this->service->request($email);
     /* Dispatch Domain Events */
     return $reminder;
 }
Exemplo n.º 2
0
 /** @test */
 public function should_request_and_return_new_reminder()
 {
     $this->users->shouldReceive('userOfEmail')->andReturn($this->user);
     $this->reminders->shouldReceive('deleteExistingRemindersForEmail');
     $this->reminders->shouldReceive('nextIdentity')->andReturn(ReminderId::generate());
     $this->reminders->shouldReceive('add');
     $reminder = $this->service->request('*****@*****.**');
     $this->assertInstanceOf('Cffs\\Domain\\Model\\Identity\\Reminder', $reminder);
 }