Skip to content

Commit d08f195

Browse files
committed
minor: add some test in the ldap component
1 parent 87855a5 commit d08f195

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/*
3+
* This file is part of the Symfony package.
4+
*
5+
* (c) Fabien Potencier <fabien@symfony.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap;
12+
13+
use PHPUnit\Framework\TestCase;
14+
use Symfony\Component\Ldap\Adapter\ExtLdap\Connection;
15+
use Symfony\Component\Ldap\Adapter\ExtLdap\EntryManager;
16+
use Symfony\Component\Ldap\Entry;
17+
18+
class EntryManagerTest extends TestCase
19+
{
20+
/**
21+
* @expectedException \Symfony\Component\Ldap\Exception\NotBoundException
22+
* @expectedExceptionMessage Query execution is not possible without binding the connection first.
23+
*/
24+
public function testGetResources()
25+
{
26+
$connection = $this->getMockBuilder(Connection::class)->getMock();
27+
$connection
28+
->expects($this->once())
29+
->method('isBound')->willReturn(false);
30+
31+
$entry = new Entry('$$$$$$');
32+
$entryManager = new EntryManager($connection);
33+
$entryManager->update($entry);
34+
}
35+
}

0 commit comments

Comments
 (0)