Adldap\Laravel\Tests\DatabaseProviderTest::test_config_login_fallback PHP Method

test_config_login_fallback() public method

    public function test_config_login_fallback()
    {
        $this->app['config']->set('adldap_auth.login_fallback', true);
        EloquentUser::create(['email' => '[email protected]', 'name' => 'John Doe', 'password' => bcrypt('Password123')]);
        $credentials = ['email' => '[email protected]', 'password' => 'Password123'];
        $this->assertTrue(Auth::attempt($credentials));
        $user = Auth::user();
        $this->assertInstanceOf('Adldap\\Laravel\\Tests\\Models\\User', $user);
        $this->assertEquals('[email protected]', $user->email);
        $this->app['config']->set('adldap_auth.login_fallback', false);
        $this->assertFalse(Auth::attempt($credentials));
    }