Inheritance: extends Illuminate\Database\Eloquent\Model, implements Illuminate\Contracts\Auth\Authenticatable, implements Illuminate\Contracts\Auth\CanResetPassword, use trait Illuminate\Auth\Authenticatable, use trait Illuminate\Auth\Passwords\CanResetPassword, use trait Adldap\Laravel\Traits\HasAdldapUser
 public function testConfigLoginFallback()
 {
     $this->app['config']->set('adldap_auth.login_fallback', true);
     EloquentUser::create(['email' => '*****@*****.**', 'name' => 'John Doe', 'password' => bcrypt('Password123')]);
     $credentials = ['email' => '*****@*****.**', 'password' => 'Password123'];
     $outcome = Auth::attempt($credentials);
     $user = \Auth::user();
     $this->assertTrue($outcome);
     $this->assertInstanceOf('Adldap\\Laravel\\Tests\\Models\\User', $user);
     $this->assertEquals('*****@*****.**', $user->email);
     $this->app['config']->set('adldap_auth.login_fallback', false);
     $outcome = Auth::attempt($credentials);
     $this->assertFalse($outcome);
 }
 public function test_config_password_sync_enabled()
 {
     $this->app['config']->set('adldap_auth.password_sync', true);
     $email = '*****@*****.**';
     $password = '******';
     $this->test_auth_passes(compact('email', 'password'));
     $user = EloquentUser::first();
     $this->assertInstanceOf(EloquentUser::class, $user);
     // This check will pass due to password synchronization being enabled.
     $this->assertTrue(Hash::check($password, $user->password));
 }
 public function test_config_login_fallback_no_connection()
 {
     $this->app['config']->set('adldap_auth.login_fallback', true);
     $mockedProvider = $this->mock(Provider::class);
     $mockedSearch = $this->mock(Factory::class);
     $mockedConnection = $this->mock(ConnectionInterface::class);
     $mockedConnection->shouldReceive('isBound')->once()->andReturn(false);
     $mockedSearch->shouldReceive('select')->once()->andReturn($mockedSearch);
     $mockedSearch->shouldReceive('users')->once()->andReturn($mockedSearch);
     $mockedSearch->shouldReceive('getConnection')->once()->andReturn($mockedConnection);
     $manager = new Manager();
     $manager->add('default', $mockedProvider);
     $mockedProvider->shouldReceive('search')->once()->andReturn($mockedSearch);
     Adldap::shouldReceive('getManager')->andReturn($manager);
     EloquentUser::create(['email' => '*****@*****.**', 'name' => 'John Doe', 'password' => bcrypt('Password123')]);
     $credentials = ['email' => '*****@*****.**', 'password' => 'Password123'];
     $outcome = Auth::attempt($credentials);
     $user = \Auth::user();
     $this->assertTrue($outcome);
     $this->assertInstanceOf('Adldap\\Laravel\\Tests\\Models\\User', $user);
     $this->assertEquals('*****@*****.**', $user->email);
 }