Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Roundcube\Tests\Framework; use PHPUnit\Framework\TestCase; use Roundcube..
Decoded Output download
<?php
namespace Roundcube\Tests\Framework;
use PHPUnit\Framework\TestCase;
use Roundcube\Tests\StderrMock;
/**
* Test class to test rcube_ldap class
*/
class LdapTest 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
cube_ldap([]);
StderrMock::stop();
$this->assertInstanceOf(
cube_ldap::class, $object, 'Class constructor');
$this->assertSame('ERROR: Could not connect to any LDAP server', trim(StderrMock::$output));
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Roundcube\Tests\Framework;
use PHPUnit\Framework\TestCase;
use Roundcube\Tests\StderrMock;
/**
* Test class to test rcube_ldap class
*/
class LdapTest 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::class, $object, 'Class constructor');
$this->assertSame('ERROR: Could not connect to any LDAP server', trim(StderrMock::$output));
}
}
Function Calls
None |
Stats
MD5 | 0ba5dec402bb255e2d21beb72138cd76 |
Eval Count | 0 |
Decode Time | 69 ms |