Esempio n. 1
0
 /**
  * @test
  */
 function it_hashes_a_password()
 {
     Session::start();
     \Illuminate\Support\Facades\Hash::shouldReceive('make')->once()->andReturn('foobar_hashed_password');
     $response = $this->action('POST', 'HashingController@postIndex', ['password' => 'foobar_password', '_token' => csrf_token()]);
     $this->assertEquals('Your hash is foobar_hashed_password', $response->getContent());
 }
Esempio n. 2
0
 public function testSetPasswordAttribute()
 {
     Hash::shouldReceive('make')->with('secret')->once()->andReturn('foo');
     $this->user->password = '******';
     $this->assertEquals('foo', $this->user->password);
 }