|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace SimpleSAML\XMLSecurity\Test\XML\xenc11; |
|
6
|
|
|
|
|
7
|
|
|
use PHPUnit\Framework\Attributes\CoversClass; |
|
|
|
|
|
|
8
|
|
|
use PHPUnit\Framework\TestCase; |
|
9
|
|
|
use SimpleSAML\XML\DOMDocumentFactory; |
|
10
|
|
|
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; |
|
11
|
|
|
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; |
|
12
|
|
|
use SimpleSAML\XMLSecurity\XML\ds\KeyName; |
|
13
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractKeyDerivationMethodType; |
|
14
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractXenc11Element; |
|
15
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\KeyDerivationMethod; |
|
16
|
|
|
|
|
17
|
|
|
use function dirname; |
|
18
|
|
|
use function strval; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Tests for the xenc:KeyDerivationMethod element. |
|
22
|
|
|
* |
|
23
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc11\AbstractXenc11Element |
|
24
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc11\AbstractKeyDerivationMethodType |
|
25
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc11\KeyDerivationMethod |
|
26
|
|
|
* @package simplesamlphp/xml-security |
|
27
|
|
|
*/ |
|
28
|
|
|
#[CoversClass(AbstractXenc11Element::class)] |
|
29
|
|
|
#[CoversClass(AbstractKeyDerivationMethodType::class)] |
|
30
|
|
|
#[CoversClass(KeyDerivationMethod::class)] |
|
31
|
|
|
final class KeyDerivationMethodTest extends TestCase |
|
32
|
|
|
{ |
|
33
|
|
|
use SchemaValidationTestTrait; |
|
|
|
|
|
|
34
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
|
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
*/ |
|
38
|
|
|
public static function setUpBeforeClass(): void |
|
39
|
|
|
{ |
|
40
|
|
|
self::$testedClass = KeyDerivationMethod::class; |
|
41
|
|
|
|
|
42
|
|
|
self::$schemaFile = dirname(__FILE__, 4) . '/resources/schemas/xenc-schema-11.xsd'; |
|
43
|
|
|
|
|
44
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
|
45
|
|
|
dirname(__FILE__, 3) . '/resources/xml/xenc11_KeyDerivationMethod.xml', |
|
46
|
|
|
); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
// test marshalling |
|
51
|
|
|
|
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Test creating an KeyDerivationMethod object from scratch. |
|
55
|
|
|
*/ |
|
56
|
|
|
public function testMarshalling(): void |
|
57
|
|
|
{ |
|
58
|
|
|
$alg = 'http://www.w3.org/2009/xmlenc11#ConcatKDF'; |
|
59
|
|
|
$keyName = new KeyName('testkey'); |
|
60
|
|
|
|
|
61
|
|
|
$kdm = new KeyDerivationMethod($alg, [$keyName]); |
|
62
|
|
|
|
|
63
|
|
|
$this->assertEquals( |
|
64
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
|
65
|
|
|
strval($kdm), |
|
66
|
|
|
); |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths