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

DigestValueTest::testMarshallingNotBase64()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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