[Ldap] add a test on parsing the rdn

This commit is contained in:
Amrouche Hamza 2019-05-20 14:13:17 +02:00
parent 2ecad3ffa9
commit 0abe32b085
No known key found for this signature in database
GPG Key ID: E45A3DA456145BC1
1 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,22 @@ use Symfony\Component\Ldap\Entry;
class EntryManagerTest extends TestCase
{
/**
* @expectedException \Symfony\Component\Ldap\Exception\LdapException
* @expectedExceptionMessage Entry "$$$$$$" malformed, could not parse RDN.
*/
public function testMove()
{
$connection = $this->createMock(Connection::class);
$connection
->expects($this->once())
->method('isBound')->willReturn(true);
$entry = new Entry('$$$$$$');
$entryManager = new EntryManager($connection);
$entryManager->move($entry, 'a');
}
/**
* @expectedException \Symfony\Component\Ldap\Exception\NotBoundException
* @expectedExceptionMessage Query execution is not possible without binding the connection first.