File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Ldap ;
13
13
14
14
use Symfony \Component \Ldap \Adapter \AdapterInterface ;
15
+ use Symfony \Component \Ldap \Adapter \EntryManagerInterface ;
16
+ use Symfony \Component \Ldap \Adapter \QueryInterface ;
15
17
use Symfony \Component \Ldap \Exception \DriverNotFoundException ;
16
18
17
19
/**
@@ -41,23 +43,23 @@ public function bind($dn = null, $password = null)
41
43
/**
42
44
* {@inheritdoc}
43
45
*/
44
- public function query ($ dn , $ query , array $ options = [])
46
+ public function query ($ dn , $ query , array $ options = []): QueryInterface
45
47
{
46
48
return $ this ->adapter ->createQuery ($ dn , $ query , $ options );
47
49
}
48
50
49
51
/**
50
52
* {@inheritdoc}
51
53
*/
52
- public function getEntryManager ()
54
+ public function getEntryManager (): EntryManagerInterface
53
55
{
54
56
return $ this ->adapter ->getEntryManager ();
55
57
}
56
58
57
59
/**
58
60
* {@inheritdoc}
59
61
*/
60
- public function escape ($ subject , $ ignore = '' , $ flags = 0 )
62
+ public function escape ($ subject , $ ignore = '' , $ flags = 0 ): string
61
63
{
62
64
return $ this ->adapter ->escape ($ subject , $ ignore , $ flags );
63
65
}
Original file line number Diff line number Diff line change 15
15
use PHPUnit \Framework \TestCase ;
16
16
use Symfony \Component \Ldap \Adapter \AdapterInterface ;
17
17
use Symfony \Component \Ldap \Adapter \ConnectionInterface ;
18
+ use Symfony \Component \Ldap \Adapter \QueryInterface ;
18
19
use Symfony \Component \Ldap \Exception \DriverNotFoundException ;
19
20
use Symfony \Component \Ldap \Ldap ;
20
21
@@ -54,6 +55,7 @@ public function testLdapEscape()
54
55
->expects ($ this ->once ())
55
56
->method ('escape ' )
56
57
->with ('foo ' , 'bar ' , 'baz ' )
58
+ ->willReturn ('' );
57
59
;
58
60
$ this ->ldap ->escape ('foo ' , 'bar ' , 'baz ' );
59
61
}
@@ -64,6 +66,7 @@ public function testLdapQuery()
64
66
->expects ($ this ->once ())
65
67
->method ('createQuery ' )
66
68
->with ('foo ' , 'bar ' , ['baz ' ])
69
+ ->willReturn ($ this ->createMock (QueryInterface::class))
67
70
;
68
71
$ this ->ldap ->query ('foo ' , 'bar ' , ['baz ' ]);
69
72
}
You can’t perform that action at this time.
0 commit comments