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

TestLdapConfigurationTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCertData() 0 21 1
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