Completed
Push — master ( 073b67...df2b0c )
by Tim
01:48
created

Negotiate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3
1
<?php
2
3
namespace SimpleSAML\Module\monitor\TestSuite\AuthSource;
4
5
use \SimpleSAML\Module\monitor\TestConfiguration as TestConfiguration;
6
use \SimpleSAML\Module\monitor\TestCase as TestCase;
7
use \SimpleSAML\Module\monitor\TestData as TestData;
8
9
final class Negotiate extends \SimpleSAML\Module\monitor\TestSuiteFactory
10
{
11
    /**
12
     * @var array
13
     */
14
    private $authSource = array();
15
16
    /**
17
     * @var array
18
     */
19
    private $serverVars = array();
20
21
    /**
22
     * @var array
23
     */
24
    private $requestVars = array();
25
26
    /**
27
     * @param TestConfiguration $configuration
28
     * @param TestData $testData
29
     */
30
    public function __construct($configuration, $testData)
31
    {
32
        $authSource = $testData->getInput('authSource');
33
        $this->serverVars = $configuration->getServerVars();
34
        $this->requestVars = $configuration->getRequestVars();
35
36
        assert(is_array($authSource));
37
        $this->authSource = $authSource;
38
39
        parent::__construct($configuration);
40
    }
41
42
    /**
43
     * @return void
44
     */
45
    protected function invokeTestSuite()
46
    {
47
        $input = array(
48
            'keytab' => $this->authSource['keytab'],
49
            'xml' => in_array('xml', get_object_vars($this->requestVars)) ? $this->requestVars->xml : null;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ';', expecting ')'
Loading history...
50
            'authorization' => in_array('HTTP_AUTHORIZATION', get_object_vars($this->serverVars)) ? $this->serverVars->HTTP_AUTHORIZATION : null;
51
        );
52
        $testData = new TestData($input);
53
54
        $test = new TestCase\AuthSource\Negotiate($this, $testData);
55
        $this->addTest($test);
56
57
        $this->addMessages($test->getMessages());
58
        $this->calculateState();
59
    }
60
}
61