Passed
Push — master ( bb5c60...87d27f )
by Tim
01:35
created

TestDataTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTestData() 0 23 1
1
<?php
2
3
namespace SimpleSAML\Modules\Monitor\Test;
4
5
use \SimpleSAML\Modules\Monitor\TestData as TestData;
6
7
/**
8
 * Tests for TestData
9
 */
10
class TestDataTest extends \PHPUnit_Framework_TestCase
11
{
12
    public function testTestData()
13
    {
14
        $input = array('test' => array(1, 2, 3));
15
        $testData = new TestData($input);
16
        $this->assertEquals($input, $testData->getInput());
17
18
        $input['blub'] = array(4, 5, 6);
19
        $testData->setInput(array('blub' => array(4, 5, 6)));
20
        $this->assertEquals($input, $testData->getInput());
21
22
        $input['mehh'] = array(7, 8, 9);
23
        $testData->setInput(array(7, 8, 9), 'mehh');
24
        $this->assertEquals($input, $testData->getInput());
25
26
        $testData->setInput(array(10), 'mehh');
27
        $input['mehh'] = array(10);
28
        $this->assertEquals($input, $testData->getInput());
29
30
        $testData->addInput('mehh', array(7, 8, 9));
31
        $input['mehh'] = array(10, 7, 8, 9);
32
        $this->assertEquals($input, $testData->getInput());
33
34
        $this->assertEquals($input['mehh'], $testData->getInputItem('mehh'));
35
    }
36
}
37