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\AbstractXenc11Element; |
14
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\OtherSource; |
15
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\Parameters; |
16
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc11\Salt; |
17
|
|
|
|
18
|
|
|
use function dirname; |
19
|
|
|
use function strval; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class \SimpleSAML\XMLSecurity\XML\xenc11\SaltTest |
23
|
|
|
* |
24
|
|
|
* @package simplesamlphp/xml-security |
25
|
|
|
*/ |
26
|
|
|
#[CoversClass(Salt::class)] |
27
|
|
|
#[CoversClass(AbstractXenc11Element::class)] |
28
|
|
|
final class SaltTest extends TestCase |
29
|
|
|
{ |
30
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
*/ |
34
|
|
|
public static function setUpBeforeClass(): void |
35
|
|
|
{ |
36
|
|
|
self::$testedClass = Salt::class; |
37
|
|
|
|
38
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
39
|
|
|
dirname(__FILE__, 3) . '/resources/xml/xenc11_Salt.xml', |
40
|
|
|
); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
|
44
|
|
|
// marshalling |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
*/ |
49
|
|
|
public function testMarshalling(): void |
50
|
|
|
{ |
51
|
|
|
$someDoc = DOMDocumentFactory::fromString( |
52
|
|
|
'<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">Some</ssp:Chunk>', |
53
|
|
|
); |
54
|
|
|
|
55
|
|
|
$parameters = new Parameters( |
56
|
|
|
[new Chunk($someDoc->documentElement)], |
57
|
|
|
[new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1')], |
58
|
|
|
); |
59
|
|
|
|
60
|
|
|
$otherSource = new OtherSource('urn:x-simplesamlphp:algorithm', $parameters); |
61
|
|
|
$salt = new Salt($otherSource); |
62
|
|
|
|
63
|
|
|
$this->assertEquals( |
64
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
65
|
|
|
strval($salt), |
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