/** @test */ public function should_find_reminder_and_return_false_when_invalid() { Carbon::setTestNow(Carbon::create(2014, 10, 11, 10, 23, 34)); $reminder = new Reminder($this->fixture['id'], $this->fixture['email'], $this->fixture['code']); Carbon::setTestNow(); $this->reminders->shouldReceive('findReminderByEmailAndCode')->andReturn($reminder); $this->assertFalse($this->service->check('*****@*****.**', 'abc123')); }
/** * Check to see if the email and token combination are valid * * @param string $email * @param string $code * @return bool */ public function check($email, $code) { if ($this->validate($email)) { return $this->service->check($email, $code); } }