Passed
Push — master ( ed50af...6a344f )
by Tim
01:40
created

TestLdapConfigurationTest::testCertData()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace SimpleSAML\Module\monitor\Test;
4
5
use \SimpleSAML\Module\monitor\TestCase as TestCase;
6
use \SimpleSAML\Module\monitor\TestData as TestData;
7
8
/**
9
 * Tests for TestCase\Ldap\Configuration
10
 */
11
class TestLdapConfigurationTest extends \PHPUnit_Framework_TestCase
12
{
13
    public function testCertData()
14
    {
15
        $authSourceData = [
16
            'hostname' => 'ldaps://ldap.example.com:636',
17
        ];
18
19
        $confTest = new TestCase\AuthSource\Ldap\Configuration(
20
            new TestData(['authSourceData' => $authSourceData])
21
        );
22
        $testResult = $confTest->getTestResult();
23
        $this->assertEquals('ldaps://ldap.example.com:636', $testResult->getSubject());
24
25
        $authSourceData = [
26
            'hostname' => 'ldap.example.com',
27
            'port' => 636,
28
            'enable_tls' => true,
29
            'timeout' => 999,
30
            'debug' => true,
31
            'referrals' => true,
32
        ];
33
34
        $confTest = new TestCase\AuthSource\Ldap\Configuration(
0 ignored issues
show
Unused Code introduced by
The assignment to $confTest is dead and can be removed.
Loading history...
35
            new TestData(['authSourceData' => $authSourceData])
36
        );
37
        $this->assertEquals('ldaps://ldap.example.com:636', $testResult->getSubject());
38
    }
39
}
40