1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\XMLSecurity\Test\XML\xenc; |
6
|
|
|
|
7
|
|
|
use PHPUnit\Framework\Attributes\CoversClass; |
|
|
|
|
8
|
|
|
use PHPUnit\Framework\TestCase; |
9
|
|
|
use SimpleSAML\Assert\AssertionFailedException; |
10
|
|
|
use SimpleSAML\XML\DOMDocumentFactory; |
11
|
|
|
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait; |
12
|
|
|
use SimpleSAML\XMLSecurity\Test\XML\XMLDumper; |
13
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc\AbstractXencElement; |
14
|
|
|
use SimpleSAML\XMLSecurity\XML\xenc\PgenCounter; |
15
|
|
|
|
16
|
|
|
use function dirname; |
17
|
|
|
use function strval; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Class \SimpleSAML\XMLSecurity\Test\XML\xenc\PgenCounterTest |
21
|
|
|
* |
22
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc\AbstractXencElement |
23
|
|
|
* @covers \SimpleSAML\XMLSecurity\XML\xenc\PgenCounter |
24
|
|
|
* |
25
|
|
|
* @package simplesamlphp/xml-security |
26
|
|
|
*/ |
27
|
|
|
#[CoversClass(AbstractXencElement::class)] |
28
|
|
|
#[CoversClass(PgenCounter::class)] |
29
|
|
|
final class PgenCounterTest extends TestCase |
30
|
|
|
{ |
31
|
|
|
use SerializableElementTestTrait; |
|
|
|
|
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
*/ |
35
|
|
|
public static function setUpBeforeClass(): void |
36
|
|
|
{ |
37
|
|
|
self::$testedClass = PgenCounter::class; |
38
|
|
|
|
39
|
|
|
self::$xmlRepresentation = DOMDocumentFactory::fromFile( |
40
|
|
|
dirname(__FILE__, 3) . '/resources/xml/xenc_pgenCounter.xml', |
41
|
|
|
); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
*/ |
47
|
|
|
public function testMarshalling(): void |
48
|
|
|
{ |
49
|
|
|
$pgenCounter = new PgenCounter('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); |
50
|
|
|
|
51
|
|
|
$this->assertEquals( |
52
|
|
|
XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation), |
53
|
|
|
strval($pgenCounter), |
54
|
|
|
); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
*/ |
60
|
|
|
public function testMarshallingNotBase64(): void |
61
|
|
|
{ |
62
|
|
|
$this->expectException(AssertionFailedException::class); |
63
|
|
|
new PgenCounter('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|
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