Passed
Push — master ( be09b3...67068d )
by Tim
13:28
created

X509IssuerNameTest::testUnmarshalling()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Test\XML\ds;
6
7
use PHPUnit\Framework\TestCase;
8
use SimpleSAML\XML\DOMDocumentFactory;
9
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
10
use SimpleSAML\XMLSecurity\XML\ds\X509IssuerName;
11
12
use function dirname;
13
use function strval;
14
15
/**
16
 * Class \SimpleSAML\XMLSecurity\XML\ds\X509IssuerNameTest
17
 *
18
 * @covers \SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement
19
 * @covers \SimpleSAML\XMLSecurity\XML\ds\X509IssuerName
20
 *
21
 * @package simplesamlphp/xml-security
22
 */
23
final class X509IssuerNameTest extends TestCase
24
{
25
    use SerializableElementTestTrait;
0 ignored issues
show
Bug introduced by
The trait SimpleSAML\XML\TestUtils...lizableElementTestTrait requires the property $documentElement which is not provided by SimpleSAML\XMLSecurity\T...L\ds\X509IssuerNameTest.
Loading history...
26
27
28
    /**
29
     */
30
    public static function setUpBeforeClass(): void
31
    {
32
        self::$testedClass = X509IssuerName::class;
33
34
        self::$xmlRepresentation = DOMDocumentFactory::fromFile(
35
            dirname(__FILE__, 3) . '/resources/xml/ds_X509IssuerName.xml',
36
        );
37
    }
38
39
40
    /**
41
     */
42
    public function testMarshalling(): void
43
    {
44
        $issuerName = new X509IssuerName('some name');
45
46
        $this->assertEquals(
47
            self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
48
            strval($issuerName),
49
        );
50
    }
51
}
52