Passed
Push — master ( 0427f4...ed50af )
by Tim
01:30
created

TestLdapConfigurationTest::testCertData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 21
rs 9.3142
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
        ];
29
30
        $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...
31
            new TestData(['authSourceData' => $authSourceData])
32
        );
33
        $this->assertEquals('ldaps://ldap.example.com:636', $testResult->getSubject());
34
    }
35
}
36