minor: add some test in the ldap component

This commit is contained in:
Amrouche Hamza 2019-05-18 09:12:43 +02:00
parent 87855a59ec
commit d08f195502
No known key found for this signature in database
GPG Key ID: E45A3DA456145BC1
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Ldap\Adapter\ExtLdap\Connection;
use Symfony\Component\Ldap\Adapter\ExtLdap\EntryManager;
use Symfony\Component\Ldap\Entry;
class EntryManagerTest extends TestCase
{
/**
* @expectedException \Symfony\Component\Ldap\Exception\NotBoundException
* @expectedExceptionMessage Query execution is not possible without binding the connection first.
*/
public function testGetResources()
{
$connection = $this->getMockBuilder(Connection::class)->getMock();
$connection
->expects($this->once())
->method('isBound')->willReturn(false);
$entry = new Entry('$$$$$$');
$entryManager = new EntryManager($connection);
$entryManager->update($entry);
}
}