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; /** * Test ..
Decoded Output download
<?php
namespace Roundcube\Tests\Framework;
use PHPUnit\Framework\TestCase;
/**
* Test class to test rcube_ldap_generic class
*/
class LdapGenericTest extends TestCase
{
protected function markTestSkippedIfNetLdapPackageIsNotInstalled(): void
{
if (!class_exists(\Net_LDAP3::class)) {
$this->markTestSkipped('The Net_LDAP3 package not available.');
}
}
/**
* Class constructor
*/
public function test_class()
{
$this->markTestSkippedIfNetLdapPackageIsNotInstalled();
$object = new \rcube_ldap_generic([]);
$this->assertInstanceOf(\rcube_ldap_generic::class, $object, 'Class constructor');
}
/**
* Test fulltext_search_filter() method
*/
public function test_fulltext_search_filter()
{
$this->markTestSkippedIfNetLdapPackageIsNotInstalled();
$object = new \rcube_ldap_generic([]);
$result = $object->fulltext_search_filter('test', ['dn']);
$this->assertSame('(|(dn=test))', $result);
$result = $object->fulltext_search_filter('test', ['dn', 'mail'], 2);
$this->assertSame('(|(dn=test*)(mail=test*))', $result);
$result = $object->fulltext_search_filter('test1 test2', ['dn', 'mail'], 0);
$this->assertSame('(&(|(dn=*test1*)(mail=*test1*))(|(dn=*test2*)(mail=*test2*)))', $result);
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Roundcube\Tests\Framework;
use PHPUnit\Framework\TestCase;
/**
* Test class to test rcube_ldap_generic class
*/
class LdapGenericTest extends TestCase
{
protected function markTestSkippedIfNetLdapPackageIsNotInstalled(): void
{
if (!class_exists(\Net_LDAP3::class)) {
$this->markTestSkipped('The Net_LDAP3 package not available.');
}
}
/**
* Class constructor
*/
public function test_class()
{
$this->markTestSkippedIfNetLdapPackageIsNotInstalled();
$object = new \rcube_ldap_generic([]);
$this->assertInstanceOf(\rcube_ldap_generic::class, $object, 'Class constructor');
}
/**
* Test fulltext_search_filter() method
*/
public function test_fulltext_search_filter()
{
$this->markTestSkippedIfNetLdapPackageIsNotInstalled();
$object = new \rcube_ldap_generic([]);
$result = $object->fulltext_search_filter('test', ['dn']);
$this->assertSame('(|(dn=test))', $result);
$result = $object->fulltext_search_filter('test', ['dn', 'mail'], 2);
$this->assertSame('(|(dn=test*)(mail=test*))', $result);
$result = $object->fulltext_search_filter('test1 test2', ['dn', 'mail'], 0);
$this->assertSame('(&(|(dn=*test1*)(mail=*test1*))(|(dn=*test2*)(mail=*test2*)))', $result);
}
}
Function Calls
None |
Stats
MD5 | 27e64511e4fa7d9e7d23a80e1a45bccc |
Eval Count | 0 |
Decode Time | 70 ms |