public function test_config_password_sync_disabled()
{
$this->app['config']->set('adldap_auth.password_sync', false);
$user = $this->getMockUser(['cn' => '', 'mail' => '[email protected]', 'samaccountname' => 'jdoe']);
$connection = $this->getMockConnection();
$connection->expects($this->exactly(1))->method('isBound')->willReturn(true);
$connection->expects($this->exactly(1))->method('search')->willReturn('resource');
$connection->expects($this->exactly(1))->method('getEntries')->willReturn(['count' => 1, $user->getAttributes()]);
$connection->expects($this->exactly(2))->method('bind')->with($this->logicalOr($this->equalTo('jdoe'), $this->equalTo('admin')))->willReturn(true);
$email = '[email protected]';
$password = '12345';
$this->assertTrue(Auth::attempt(compact('email', 'password')));
$user = Auth::user();
// This check will fail due to password synchronization being disabled.
$this->assertFalse(Hash::check($password, $user->password));
}