Files
roundcubemail/tests/Framework/Ldap.php
Michael Voříšek 54f4aa33f9 Fix CS - imports (#9316)
* fix Tests\Browser\TestCase imports

* fix remaining imports

* fix PHPUnit\Framework\TestCase imports

* import GuzzleHttp\Client

* fix remaining

* "php_unit_method_casing" is not todo

* fix "single_line_comment_spacing"

* fix 2nd commit done using older fixer
2024-01-21 19:13:31 +01:00

33 lines
845 B
PHP

<?php
use PHPUnit\Framework\TestCase;
/**
* Test class to test rcube_ldap class
*/
class Framework_Ldap extends TestCase
{
/**
* Class constructor
*/
public function test_class()
{
// skip test if Net_LDAP3 does not exist
if (!class_exists('Net_LDAP3')) {
$this->markTestSkipped('The Net_LDAP3 package not available.');
}
// skip test if php-ldap is not available
if (!extension_loaded('ldap')) {
$this->markTestSkipped('The ldap extension is not available.');
}
StderrMock::start();
$object = new rcube_ldap([]);
StderrMock::stop();
$this->assertInstanceOf('rcube_ldap', $object, 'Class constructor');
$this->assertSame('ERROR: Could not connect to any LDAP server', trim(StderrMock::$output));
}
}