1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\XMLSecurity\Test\XML\ds; |
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\AbstractDsElement; |
13
|
|
|
use SimpleSAML\XMLSecurity\XML\ds\AbstractSPKIDataType; |
14
|
|
|
use SimpleSAML\XMLSecurity\XML\ds\SPKIData; |
15
|
|
|
use SimpleSAML\XMLSecurity\XML\ds\SPKISexp; |
16
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc\CarriedKeyName; |
17
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc\Seed; |
18
|
|
|
|
19
|
|
|
use function dirname; |
20
|
|
|
use function strval; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class \SimpleSAML\XMLSecurity\Test\XML\ds\SPKIDataTest |
24
|
|
|
* |
25
|
|
|
* @package simplesamlphp/xml-security |
26
|
|
|
*/ |
27
|
|
|
#[CoversClass(AbstractDsElement::class)] |
28
|
|
|
#[CoversClass(AbstractSPKIDataType::class)] |
29
|
|
|
#[CoversClass(SPKIData::class)] |
30
|
|
|
final class SPKIDataTest extends TestCase |
31
|
|
|
{ |
32
|
|
|
use SchemaValidationTestTrait; |
|
|
|
|
33
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
*/ |
37
|
|
|
public static function setUpBeforeClass(): void |
38
|
|
|
{ |
39
|
|
|
self::$testedClass = SPKIData::class; |
40
|
|
|
|
41
|
|
|
self::$schemaFile = dirname(__FILE__, 4) . '/resources/schemas/xmldsig1-schema.xsd'; |
42
|
|
|
|
43
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
44
|
|
|
dirname(__FILE__, 3) . '/resources/xml/ds_SPKIData.xml', |
45
|
|
|
); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
*/ |
51
|
|
|
public function testMarshalling(): void |
52
|
|
|
{ |
53
|
|
|
$SPKISexp1 = new SPKISexp('GpM6'); |
54
|
|
|
$seed = new Seed('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); |
55
|
|
|
$SPKISexp2 = new SPKISexp('GpM7'); |
56
|
|
|
$SPKISexp3 = new SPKISexp('GpM8'); |
57
|
|
|
$carriedKeyName = new CarriedKeyName('Some label'); |
58
|
|
|
|
59
|
|
|
$SPKIData = new SPKIData([ |
60
|
|
|
[$SPKISexp1, $seed], |
61
|
|
|
[$SPKISexp2, null], |
62
|
|
|
[$SPKISexp3, $carriedKeyName], |
63
|
|
|
]); |
64
|
|
|
|
65
|
|
|
$this->assertEquals( |
66
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
67
|
|
|
strval($SPKIData), |
68
|
|
|
); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
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