Passed
Pull Request — master (#60)
by Tim
02:12
created

X509SKITest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 3
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\SerializableElementTestTrait;
11
use SimpleSAML\XML\Type\Base64BinaryValue;
12
use SimpleSAML\XMLSecurity\Test\XML\XMLDumper;
13
use SimpleSAML\XMLSecurity\XML\ds\{AbstractDsElement, X509SKI};
14
15
use function dirname;
16
use function strval;
17
18
/**
19
 * Class \SimpleSAML\XMLSecurity\Test\XML\ds\X509SKITest
20
 *
21
 * @package simplesamlphp/xml-security
22
 */
23
#[Group('ds')]
24
#[CoversClass(AbstractDsElement::class)]
25
#[CoversClass(X509SKI::class)]
26
final class X509SKITest extends TestCase
27
{
28
    use SerializableElementTestTrait;
29
30
    /**
31
     */
32
    public static function setUpBeforeClass(): void
33
    {
34
        self::$testedClass = X509SKI::class;
35
36
        self::$xmlRepresentation = DOMDocumentFactory::fromFile(
37
            dirname(__FILE__, 3) . '/resources/xml/ds_X509SKI.xml',
38
        );
39
    }
40
41
42
    /**
43
     */
44
    public function testMarshalling(): void
45
    {
46
        $X509SKI = new X509SKI(
47
            Base64BinaryValue::fromString('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='),
48
        );
49
50
        $this->assertEquals(
51
            XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation),
52
            strval($X509SKI),
53
        );
54
    }
55
}
56