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
|
|
|
|