shouldDeferMissing() public method

This is particularly useless for this class, as it doesn't have a parent, but included for completeness
public shouldDeferMissing ( ) : Mock
return Mock
Ejemplo n.º 1
0
 /**
  * @test sendNewPassword() can send a new password
  */
 public function sendNewPassword_can_send_a_new_password()
 {
     $user = Mockery::mock();
     $user->shouldReceive('getAttribute')->with('email')->once()->andReturn('baz');
     $user->shouldReceive('getAttribute')->with('first_name')->once()->andReturn('John');
     $user->shouldReceive('getAttribute')->with('last_name')->once()->andReturn('Doe');
     $user->shouldReceive('checkResetPasswordCode')->with('foo')->once()->andReturn(true);
     $user->shouldReceive('getId')->withNoArgs()->once()->andReturn(1);
     $user->shouldReceive('attemptResetPassword')->with('foo', 'bar')->once()->andReturn(true);
     $throttle = Mockery::mock();
     $throttle->shouldReceive('unsuspend')->withNoArgs()->once()->andReturn(true);
     $this->sentry->shouldDeferMissing();
     $this->sentry->shouldReceive('findUserById')->with(1)->once()->andReturn($user);
     $this->mockably->shouldReceive('str_random')->with(16)->once()->andReturn('bar');
     $this->sentry->shouldReceive('findThrottlerByUserId')->with(1)->once()->andReturn($throttle);
     $this->applyConfigFixture();
     $this->lang->shouldReceive('get')->with('larapress::email.Password Reset!')->once()->andReturn('Subject');
     $this->mail->shouldReceive('send')->once();
     $this->mail->shouldReceive('failures')->once()->andReturn(array());
     $narrator = $this->getNarratorInstance();
     $narrator->sendNewPassword(1, 'foo');
     $this->assertEquals('Sending the email containing the new password failed. ' . 'Please try again later or contact the administrator.', $narrator->getMailErrorMessage());
 }
Ejemplo n.º 2
0
 /**
  * @test getCurrentTimeDifference() can throw an exception on bad calls
  * @expectedException BadMethodCallException
  */
 public function getCurrentTimeDifference_can_throw_an_exception_on_bad_calls()
 {
     $this->mockably->shouldDeferMissing();
     $helpers = $this->getHelpersInstance();
     $helpers->getCurrentTimeDifference(0.0, 'foo');
 }