Passed
Push — master ( 2f478b...56a532 )
by Tim
02:08
created

MgmtDataTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testMarshalling() 0 7 1
A setUpBeforeClass() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Test\XML\ds;
6
7
use PHPUnit\Framework\Attributes\CoversClass;
1 ignored issue
show
Bug introduced by
The type PHPUnit\Framework\Attributes\CoversClass was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use PHPUnit\Framework\TestCase;
9
use SimpleSAML\XML\DOMDocumentFactory;
10
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
11
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
12
use SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement;
13
use SimpleSAML\XMLSecurity\XML\ds\MgmtData;
14
15
use function dirname;
16
use function strval;
17
18
/**
19
 * Class \SimpleSAML\XMLSecurity\Test\XML\ds\MgmtDataTest
20
 *
21
 * @package simplesamlphp/xml-security
22
 */
23
#[CoversClass(AbstractDsElement::class)]
24
#[CoversClass(MgmtData::class)]
25
final class MgmtDataTest extends TestCase
26
{
27
    use SchemaValidationTestTrait;
0 ignored issues
show
introduced by
The trait SimpleSAML\XML\TestUtils\SchemaValidationTestTrait requires some properties which are not provided by SimpleSAML\XMLSecurity\Test\XML\ds\MgmtDataTest: $documentElement, $ownerDocument, $message, $line
Loading history...
28
    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\Test\XML\ds\MgmtDataTest.
Loading history...
29
30
    /**
31
     */
32
    public static function setUpBeforeClass(): void
33
    {
34
        self::$testedClass = MgmtData::class;
35
36
        self::$schemaFile = dirname(__FILE__, 4) . '/resources/schemas/xmldsig1-schema.xsd';
37
38
        self::$xmlRepresentation = DOMDocumentFactory::fromFile(
39
            dirname(__FILE__, 3) . '/resources/xml/ds_MgmtData.xml',
40
        );
41
    }
42
43
44
    /**
45
     */
46
    public function testMarshalling(): void
47
    {
48
        $mgmtData = new MgmtData('ManagementData');
49
50
        $this->assertEquals(
51
            self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
52
            strval($mgmtData),
53
        );
54
    }
55
}
56