1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\Test\SAML2\XML\xenc11; |
6
|
|
|
|
7
|
|
|
use PHPUnit\Framework\Attributes\CoversClass; |
|
|
|
|
8
|
|
|
use PHPUnit\Framework\TestCase; |
9
|
|
|
use SimpleSAML\XML\Attribute as XMLAttribute; |
10
|
|
|
use SimpleSAML\XML\Chunk; |
11
|
|
|
use SimpleSAML\XML\DOMDocumentFactory; |
12
|
|
|
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; |
13
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractAlgorithmIdentifierType; |
14
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractXenc11Element; |
15
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\OtherSource; |
16
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\Parameters; |
17
|
|
|
|
18
|
|
|
use function dirname; |
19
|
|
|
use function strval; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class \SimpleSAML\XMLSecurity\XML\xenc11\OtherSourceTest |
23
|
|
|
* |
24
|
|
|
* @package simplesamlphp/xml-security |
25
|
|
|
*/ |
26
|
|
|
#[CoversClass(OtherSource::class)] |
27
|
|
|
#[CoversClass(AbstractAlgorithmIdentifierType::class)] |
28
|
|
|
#[CoversClass(AbstractXenc11Element::class)] |
29
|
|
|
final class OtherSourceTest extends TestCase |
30
|
|
|
{ |
31
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
*/ |
35
|
|
|
public static function setUpBeforeClass(): void |
36
|
|
|
{ |
37
|
|
|
self::$testedClass = OtherSource::class; |
38
|
|
|
|
39
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
40
|
|
|
dirname(__FILE__, 3) . '/resources/xml/xenc11_OtherSource.xml', |
41
|
|
|
); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
// marshalling |
46
|
|
|
|
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
*/ |
50
|
|
|
public function testMarshalling(): void |
51
|
|
|
{ |
52
|
|
|
$chunk = new Chunk(DOMDocumentFactory::fromString( |
53
|
|
|
<<<XML |
54
|
|
|
<ssp:AuthenticationContextDeclaration xmlns:ssp="urn:x-simplesamlphp:namespace"> |
55
|
|
|
<ssp:Identification nym="verinymity"> |
56
|
|
|
<ssp:Extension> |
57
|
|
|
<ssp:NoVerification/> |
58
|
|
|
</ssp:Extension> |
59
|
|
|
</ssp:Identification> |
60
|
|
|
</ssp:AuthenticationContextDeclaration> |
61
|
|
|
XML |
62
|
|
|
, |
63
|
|
|
)->documentElement); |
64
|
|
|
|
65
|
|
|
$parameters = new Parameters( |
66
|
|
|
[$chunk], |
67
|
|
|
[new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1')], |
68
|
|
|
); |
69
|
|
|
|
70
|
|
|
$otherSource = new OtherSource('urn:x-simplesamlphp:algorithm', $parameters); |
71
|
|
|
|
72
|
|
|
$this->assertEquals( |
73
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
74
|
|
|
strval($otherSource), |
75
|
|
|
); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
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