1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\XMLSecurity\Test\XML\xenc; |
6
|
|
|
|
7
|
|
|
use DOMDocument; |
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\XML\xenc\CipherData; |
14
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc\CipherValue; |
15
|
|
|
use SimpleSAML\XMLSecurity\XMLSecurityDsig; |
|
|
|
|
16
|
|
|
|
17
|
|
|
use function dirname; |
18
|
|
|
use function strval; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Class \SimpleSAML\XMLSecurity\Test\XML\xenc\CipherDataTest |
22
|
|
|
* |
23
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc\AbstractXencElement |
24
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc\CipherData |
25
|
|
|
* |
26
|
|
|
* @package simplesamlphp/xml-security |
27
|
|
|
*/ |
28
|
|
|
final class CipherDataTest extends TestCase |
29
|
|
|
{ |
30
|
|
|
use SchemaValidationTestTrait; |
|
|
|
|
31
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
*/ |
35
|
|
|
public static function setUpBeforeClass(): void |
36
|
|
|
{ |
37
|
|
|
self::$testedClass = CipherData::class; |
38
|
|
|
|
39
|
|
|
self::$schemaFile = dirname(__FILE__, 4) . '/resources/schemas/xenc-schema.xsd'; |
40
|
|
|
|
41
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
42
|
|
|
dirname(__FILE__, 3) . '/resources/xml/xenc_CipherData.xml', |
43
|
|
|
); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
// marshalling |
48
|
|
|
|
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
*/ |
52
|
|
|
public function testMarshalling(): void |
53
|
|
|
{ |
54
|
|
|
$cipherData = new CipherData(new CipherValue('c29tZSB0ZXh0')); |
55
|
|
|
|
56
|
|
|
$this->assertEquals( |
57
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
58
|
|
|
strval($cipherData), |
59
|
|
|
); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
|
63
|
|
|
// unmarshalling |
64
|
|
|
|
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
*/ |
68
|
|
|
public function testUnmarshalling(): void |
69
|
|
|
{ |
70
|
|
|
$cipherData = CipherData::fromXML(self::$xmlRepresentation->documentElement); |
71
|
|
|
|
72
|
|
|
$this->assertEquals( |
73
|
|
|
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), |
74
|
|
|
strval($cipherData), |
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