Passed
Push — master ( 2d3781...f48916 )
by Tim
11:07 queued 06:44
created

PRFTest::testMarshalling()   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\Test\SAML2\XML\xenc11;
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\xenc11\AbstractAlgorithmIdentifierType;
12
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractPRFAlgorithmIdentifierType;
13
use SimpleSAML\XMLSecurity\XML\xenc11\AbstractXenc11Element;
14
use SimpleSAML\XMLSecurity\XML\xenc11\PRF;
15
16
use function dirname;
17
use function strval;
18
19
/**
20
 * Class \SimpleSAML\XMLSecurity\XML\xenc11\PRFTest
21
 *
22
 * @package simplesamlphp/xml-security
23
 */
24
#[CoversClass(PRF::class)]
25
#[CoversClass(AbstractPRFAlgorithmIdentifierType::class)]
26
#[CoversClass(AbstractAlgorithmIdentifierType::class)]
27
#[CoversClass(AbstractXenc11Element::class)]
28
final class PRFTest extends TestCase
29
{
30
    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\Test\SAML2\XML\xenc11\PRFTest.
Loading history...
31
32
    /**
33
     */
34
    public static function setUpBeforeClass(): void
35
    {
36
        self::$testedClass = PRF::class;
37
38
        self::$xmlRepresentation = DOMDocumentFactory::fromFile(
39
            dirname(__FILE__, 3) . '/resources/xml/xenc11_PRF.xml',
40
        );
41
    }
42
43
44
    // marshalling
45
46
47
    /**
48
     */
49
    public function testMarshalling(): void
50
    {
51
        $prf = new PRF('urn:x-simplesamlphp:algorithm');
52
53
        $this->assertEquals(
54
            self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
55
            strval($prf),
56
        );
57
    }
58
}
59