|
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\Chunk; |
|
10
|
|
|
use SimpleSAML\XML\DOMDocumentFactory; |
|
11
|
|
|
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait; |
|
12
|
|
|
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; |
|
13
|
|
|
use SimpleSAML\XMLSecurity\Constants as C; |
|
14
|
|
|
use SimpleSAML\XMLSecurity\XML\ds\DigestMethod; |
|
15
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractConcatKDFParamsType; |
|
16
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractXenc11Element; |
|
17
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\ConcatKDFParams; |
|
18
|
|
|
|
|
19
|
|
|
use function dirname; |
|
20
|
|
|
use function strval; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class \SimpleSAML\XMLSecurity\XML\Test\xenc11\ConcatKDFParamsTest |
|
24
|
|
|
* |
|
25
|
|
|
* @package simplesamlphp/xml-security |
|
26
|
|
|
*/ |
|
27
|
|
|
#[CoversClass(AbstractXenc11Element::class)] |
|
28
|
|
|
#[CoversClass(AbstractConcatKDFParamsType::class)] |
|
29
|
|
|
#[CoversClass(ConcatKDFParams::class)] |
|
30
|
|
|
final class ConcatKDFParamsTest extends TestCase |
|
31
|
|
|
{ |
|
32
|
|
|
use SchemaValidationTestTrait; |
|
|
|
|
|
|
33
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
|
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
*/ |
|
37
|
|
|
public static function setUpBeforeClass(): void |
|
38
|
|
|
{ |
|
39
|
|
|
self::$testedClass = ConcatKDFParams::class; |
|
40
|
|
|
|
|
41
|
|
|
self::$schemaFile = dirname(__FILE__, 4) . '/resources/schemas/xenc-schema-11.xsd'; |
|
42
|
|
|
|
|
43
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
|
44
|
|
|
dirname(__FILE__, 3) . '/resources/xml/xenc11_ConcatKDFParams.xml', |
|
45
|
|
|
); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
*/ |
|
51
|
|
|
public function testMarshalling(): void |
|
52
|
|
|
{ |
|
53
|
|
|
$digestMethod = new DigestMethod( |
|
54
|
|
|
C::DIGEST_SHA256, |
|
55
|
|
|
[ |
|
56
|
|
|
new Chunk(DOMDocumentFactory::fromString( |
|
57
|
|
|
'<some:Chunk xmlns:some="urn:test:some">Random</some:Chunk>', |
|
58
|
|
|
)->documentElement), |
|
59
|
|
|
], |
|
60
|
|
|
); |
|
61
|
|
|
|
|
62
|
|
|
$concatKdfParams = new ConcatKDFParams( |
|
63
|
|
|
$digestMethod, |
|
64
|
|
|
'a1b2', |
|
65
|
|
|
'b2c3', |
|
66
|
|
|
'c3d4', |
|
67
|
|
|
'd4e5', |
|
68
|
|
|
'e5f6', |
|
69
|
|
|
); |
|
70
|
|
|
|
|
71
|
|
|
$this->assertEquals( |
|
72
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
|
73
|
|
|
strval($concatKdfParams), |
|
74
|
|
|
); |
|
75
|
|
|
} |
|
76
|
|
|
} |
|
77
|
|
|
|
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