1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\Test\XMLSecurity\Type; |
6
|
|
|
|
7
|
|
|
use PHPUnit\Framework\Attributes\CoversClass; |
|
|
|
|
8
|
|
|
use PHPUnit\Framework\Attributes\DataProvider; |
|
|
|
|
9
|
|
|
use PHPUnit\Framework\TestCase; |
10
|
|
|
use SimpleSAML\XML\Exception\SchemaViolationException; |
11
|
|
|
use SimpleSAML\XMLSecurity\Type\DigestValueValue; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Class \SimpleSAML\Test\XMLSecurity\Type\DigestValueValueTest |
15
|
|
|
* |
16
|
|
|
* @package simplesamlphp/xml-security |
17
|
|
|
*/ |
18
|
|
|
#[CoversClass(DigestValueValue::class)] |
19
|
|
|
final class DigestValueValueTest extends TestCase |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @param boolean $shouldPass |
23
|
|
|
* @param string $digestValue |
24
|
|
|
*/ |
25
|
|
|
#[DataProvider('provideDigestValue')] |
26
|
|
|
public function testDigestValue(bool $shouldPass, string $digestValue): void |
27
|
|
|
{ |
28
|
|
|
try { |
29
|
|
|
DigestValueValue::fromString($digestValue); |
30
|
|
|
$this->assertTrue($shouldPass); |
31
|
|
|
} catch (SchemaViolationException $e) { |
32
|
|
|
$this->assertFalse($shouldPass); |
33
|
|
|
} |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @return array<string, array{0: bool, 1: string}> |
39
|
|
|
*/ |
40
|
|
|
public static function provideDigestValue(): array |
41
|
|
|
{ |
42
|
|
|
return [ |
43
|
|
|
'empty' => [false, ''], |
44
|
|
|
'valid' => [true, 'U2ltcGxlU0FNTHBocA=='], |
45
|
|
|
'illegal characters' => [false, '&*$(#&^@!(^%$'], |
46
|
|
|
'length not dividable by 4' => [false, 'U2ltcGxlU0FTHBocA=='], |
47
|
|
|
]; |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths