Exemplo n.º 1
0
 public function testShouldSendForgotPassword()
 {
     // Should call forgotPassword of the repository
     ConfideUser::$app['confide.repository'] = m::mock('ConfideRepository');
     ConfideUser::$app['confide.repository']->shouldReceive('forgotPassword')->with($this->confide_user)->andReturn(true)->once();
     // Should send an email once
     ConfideUser::$app['mailer'] = m::mock('Mail');
     ConfideUser::$app['mailer']->shouldReceive('send')->andReturn(null)->atLeast(1);
     $this->populateUser();
     $old_password = $this->confide_user->password;
     $this->assertTrue($this->confide_user->forgotPassword());
 }