Passed
Push — master ( 633469...6fda02 )
by Tim
02:18
created

SeedTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpBeforeClass() 0 6 1
A testMarshalling() 0 7 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\SerializableElementTestTrait;
11
use SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement;
12
use SimpleSAML\XMLSecurity\XML\ds\Seed;
13
14
use function dirname;
15
use function strval;
16
17
/**
18
 * Class \SimpleSAML\XMLSecurity\Test\XML\ds\SeedTest
19
 *
20
 * @package simplesamlphp/xml-security
21
 */
22
#[CoversClass(AbstractDsElement::class)]
23
#[CoversClass(Seed::class)]
24
final class SeedTest extends TestCase
25
{
26
    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\SeedTest.
Loading history...
27
28
    /**
29
     */
30
    public static function setUpBeforeClass(): void
31
    {
32
        self::$testedClass = Seed::class;
33
34
        self::$xmlRepresentation = DOMDocumentFactory::fromFile(
35
            dirname(__FILE__, 3) . '/resources/xml/ds_Seed.xml',
36
        );
37
    }
38
39
40
    /**
41
     */
42
    public function testMarshalling(): void
43
    {
44
        $seed = new Seed('GpM6');
45
46
        $this->assertEquals(
47
            self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
48
            strval($seed),
49
        );
50
    }
51
}
52