19
19
use Symfony \Component \Ldap \LdapInterface ;
20
20
use Symfony \Component \Ldap \Security \LdapUser ;
21
21
use Symfony \Component \Ldap \Security \LdapUserProvider ;
22
+ use Symfony \Component \Security \Core \Exception \InvalidArgumentException ;
23
+ use Symfony \Component \Security \Core \Exception \UsernameNotFoundException ;
22
24
23
25
/**
24
26
* @requires extension ldap
@@ -27,7 +29,7 @@ class LdapUserProviderTest extends TestCase
27
29
{
28
30
public function testLoadUserByUsernameFailsIfCantConnectToLdap ()
29
31
{
30
- $ this ->expectException (\ Symfony \ Component \ Security \ Core \ Exception \ UsernameNotFoundException::class);
32
+ $ this ->expectException (UsernameNotFoundException::class);
31
33
32
34
$ ldap = $ this ->createMock (LdapInterface::class);
33
35
$ ldap
@@ -42,7 +44,7 @@ public function testLoadUserByUsernameFailsIfCantConnectToLdap()
42
44
43
45
public function testLoadUserByUsernameFailsIfNoLdapEntries ()
44
46
{
45
- $ this ->expectException (\ Symfony \ Component \ Security \ Core \ Exception \ UsernameNotFoundException::class);
47
+ $ this ->expectException (UsernameNotFoundException::class);
46
48
47
49
$ result = $ this ->createMock (CollectionInterface::class);
48
50
$ query = $ this ->createMock (QueryInterface::class);
@@ -74,7 +76,7 @@ public function testLoadUserByUsernameFailsIfNoLdapEntries()
74
76
75
77
public function testLoadUserByUsernameFailsIfMoreThanOneLdapEntry ()
76
78
{
77
- $ this ->expectException (\ Symfony \ Component \ Security \ Core \ Exception \ UsernameNotFoundException::class);
79
+ $ this ->expectException (UsernameNotFoundException::class);
78
80
79
81
$ result = $ this ->createMock (CollectionInterface::class);
80
82
$ query = $ this ->createMock (QueryInterface::class);
@@ -106,7 +108,7 @@ public function testLoadUserByUsernameFailsIfMoreThanOneLdapEntry()
106
108
107
109
public function testLoadUserByUsernameFailsIfMoreThanOneLdapPasswordsInEntry ()
108
110
{
109
- $ this ->expectException (\ Symfony \ Component \ Security \ Core \ Exception \ InvalidArgumentException::class);
111
+ $ this ->expectException (InvalidArgumentException::class);
110
112
111
113
$ result = $ this ->createMock (CollectionInterface::class);
112
114
$ query = $ this ->createMock (QueryInterface::class);
@@ -183,7 +185,7 @@ public function testLoadUserByUsernameShouldNotFailIfEntryHasNoUidKeyAttribute()
183
185
184
186
public function testLoadUserByUsernameFailsIfEntryHasNoPasswordAttribute ()
185
187
{
186
- $ this ->expectException (\ Symfony \ Component \ Security \ Core \ Exception \ InvalidArgumentException::class);
188
+ $ this ->expectException (InvalidArgumentException::class);
187
189
188
190
$ result = $ this ->createMock (CollectionInterface::class);
189
191
$ query = $ this ->createMock (QueryInterface::class);
0 commit comments