public function testHashesPasswordWhenSet() { Hash::shouldReceive('make')->once()->andReturn('hashed'); $item = new User(); $item->password = '******'; $this->assertEquals('hashed', $item->password); }
/** @test */ public function it_not_set_remember_me_cookie_when_remember_not_checked() { Hash::shouldReceive('check')->once()->andReturn(true)->shouldReceive('needsRehash')->once()->andReturn(false); $user = $this->getUserForAuth(); $this->visit('/auth/login')->submitForm(['email' => $user->email, 'password' => 'test123', 'remember' => false])->notSeeCookie(Auth::getRecallerName()); }