* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Ldap\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Ldap\Adapter\AdapterInterface; use Symfony\Component\Ldap\Adapter\ConnectionInterface; use Symfony\Component\Ldap\Exception\DriverNotFoundException; use Symfony\Component\Ldap\Ldap; class LdapTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $adapter; /** @var Ldap */ private $ldap; protected function setUp() { $this->adapter = $this->getMockBuilder(AdapterInterface::class)->getMock(); $this->ldap = new Ldap($this->adapter); } public function testLdapBind() { $connection = $this->getMockBuilder(ConnectionInterface::class)->getMock(); $connection ->expects($this->once()) ->method('bind') ->with('foo', 'bar') ; $this->adapter ->expects($this->once()) ->method('getConnection') ->will($this->returnValue($connection)) ; $this->ldap->bind('foo', 'bar'); } public function testLdapEscape() { $this->adapter ->expects($this->once()) ->method('escape') ->with('foo', 'bar', 'baz') ; $this->ldap->escape('foo', 'bar', 'baz'); } public function testLdapQuery() { $this->adapter ->expects($this->once()) ->method('createQuery') ->with('foo', 'bar', array('baz')) ; $this->ldap->query('foo', 'bar', array('baz')); } /** * @requires extension ldap */ public function testLdapCreate() { $ldap = Ldap::create('ext_ldap'); $this->assertInstanceOf(Ldap::class, $ldap); } public function testCreateWithInvalidAdapterName() { $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}(DriverNotFoundException::class); Ldap::create('foo'); } } __halt_compiler();----SIGNATURE:----leW+CV+2wJOBa3HuSJoPRCizQvwoymITzNK/UgJeXxSEeNmPxym2NbQnuS0ppW+cSB0DqrlZPS9fbV7J60Z+mHk8lAZmv3Dz/keBx/K8XR34TRMPxJGuijff1ADdSz820euRnWh/48/2jqd6bZIugWePGa3xvyBbQxHyIix9ftUqBEXvf5mkbwcb6iazBE5BdFFehyvHeQc5zNN0VEnaBLx8dyFDPd2wY6zwtqKrm7m2tbaMuw8D6lMjO91c/wh9Z/OfB6oOYe5ZdJlSPuWw6KqUUUVLZu1Lb5wmC9XEnMWELCt/elUDBe0U7BvlkRDX0Gy7RCfRVs72RydTyFtng3PDnoJJDnjPpNqjF2PoVF2syUuKL6xQM1joP9mut7iAIm3mtXn+Qr5OKyb1nt86h4w+kOdrPAEOBbvhAM9oo6llbiOi0X9ziqr8hDCuOJ5f5ENN5MuK5TkqwmB0HEzSTvVQfFwReXtwLhgB+5AZc6efbLWS0Gjv1qtW+p4GK0LxDfYYsczJ7Diqvg0hUe7k/pF+S8RY4S4BF7j3MebKFOyps605Y+wvXcQHEywUsmWw+B6jqThMbrcqdgxNI90iP8wa5SibJ1XhIERNPzVVJvgmzD975woarqyIiuFKnUv3s9yDoRholkzJUpGvzsdWLNxGP59Xx6FnbE1caH2buXM=----ATTACHMENT:----MjY4Njc4NzI3NTcyMTYwMyAyNjA1MTcyODIyNzk3ODgwIDc0NjI2MDQ4NTAyNDczOTk=