Skip to content

Commit 3d24f5c

Browse files
committed
Import testcases from base repo
1 parent 44fd0bf commit 3d24f5c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace SimpleSAML\Test\Module\ldap\Auth\Process;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use SimpleSAML\Module\ldap\Auth\Process\BaseFilter;
7+
8+
class BaseFilterTest extends TestCase
9+
{
10+
/**
11+
* @return void
12+
*/
13+
public function testVarExportHidesLdapPassword()
14+
{
15+
$stub = $this->getMockBuilder(BaseFilter::class)
16+
->disableOriginalConstructor()
17+
->getMockForAbstractClass();
18+
$class = new \ReflectionClass($stub);
19+
$method = $class->getMethod('var_export');
20+
$method->setAccessible(true);
21+
22+
$this->assertEquals(
23+
"array ( 'ldap.hostname' => 'ldap://172.17.101.32', 'ldap.port' => 389, 'ldap.password' => '********', )",
24+
$method->invokeArgs($stub, [[
25+
'ldap.hostname' => 'ldap://172.17.101.32',
26+
'ldap.port' => 389,
27+
'ldap.password' => 'password',
28+
]])
29+
);
30+
}
31+
}

0 commit comments

Comments
 (0)