|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace SimpleSAML\XMLSecurity\Test\XML\ds; |
|
6
|
|
|
|
|
7
|
|
|
use PHPUnit\Framework\Attributes\{CoversClass, Group}; |
|
|
|
|
|
|
8
|
|
|
use PHPUnit\Framework\TestCase; |
|
9
|
|
|
use SimpleSAML\XML\DOMDocumentFactory; |
|
10
|
|
|
use SimpleSAML\XML\TestUtils\{SchemaValidationTestTrait, SerializableElementTestTrait}; |
|
11
|
|
|
use SimpleSAML\XML\Type\{Base64BinaryValue, IDValue}; |
|
12
|
|
|
use SimpleSAML\XMLSecurity\XML\ds\{AbstractDsElement, SignatureValue}; |
|
13
|
|
|
|
|
14
|
|
|
use function dirname; |
|
15
|
|
|
use function strval; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Class \SimpleSAML\XMLSecurity\Test\XML\ds\SignatureValueTest |
|
19
|
|
|
* |
|
20
|
|
|
* @package simplesamlphp/xml-security |
|
21
|
|
|
*/ |
|
22
|
|
|
#[Group('ds')] |
|
23
|
|
|
#[CoversClass(AbstractDsElement::class)] |
|
24
|
|
|
#[CoversClass(SignatureValue::class)] |
|
25
|
|
|
final class SignatureValueTest extends TestCase |
|
26
|
|
|
{ |
|
27
|
|
|
use SchemaValidationTestTrait; |
|
28
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
|
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Set up the test. |
|
32
|
|
|
*/ |
|
33
|
|
|
public static function setUpBeforeClass(): void |
|
34
|
|
|
{ |
|
35
|
|
|
self::$testedClass = SignatureValue::class; |
|
36
|
|
|
|
|
37
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
|
38
|
|
|
dirname(__FILE__, 3) . '/resources/xml/ds_SignatureValue.xml', |
|
39
|
|
|
); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Test creating a SignatureValue from scratch. |
|
45
|
|
|
*/ |
|
46
|
|
|
public function testMarshalling(): void |
|
47
|
|
|
{ |
|
48
|
|
|
$signatureValue = new SignatureValue( |
|
49
|
|
|
Base64BinaryValue::fromString( |
|
50
|
|
|
'j14G9v6AnsOiEJYgkTg864DG3e/KLqoGpuybPGSGblVTn7ST6M/BsvP7YiVZjLqJEuEvWmf2mW4DPb+pbArzzDcsLWEtNveMrw+F' . |
|
51
|
|
|
'kWehDUQV9oe20iepo+W46wmj7zB/eWL+Z8MrGvlycoTndJU6CVwHTLsB+dq2FDa7JV4pAPjMY32JZTbiwKhzqw3nEi/eVrujJE4Y' . |
|
52
|
|
|
'RrlW28D+rXhITfoUAGGvsqPzcwGzp02lnMe2SmXADY1u9lbVjOhUrJpgvWfn9YuiCR+wjvaGMwIwzfJxChLJZOBV+1ad1CyNTiu6' . |
|
53
|
|
|
'qAblxZ4F8cWlMWJ7f0KkWvtw66HOf2VNR6Qan2Ra7Q==', |
|
54
|
|
|
), |
|
55
|
|
|
IDValue::fromString('abc123'), |
|
56
|
|
|
); |
|
57
|
|
|
|
|
58
|
|
|
$this->assertEquals( |
|
59
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
|
60
|
|
|
strval($signatureValue), |
|
61
|
|
|
); |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|
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