Skip to content

Commit 7c6b153

Browse files
committed
Move signature wrapping tests to vulnerabilities-dir
1 parent caca9ac commit 7c6b153

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

tests/Vulnerabilities/GoldenSAMLResponseTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace SimpleSAML\Test\SAML2\Response;
66

7-
use PHPUnit\Framework\Attributes\CoversClass;
87
use PHPUnit\Framework\Attributes\Group;
98
use PHPUnit\Framework\TestCase;
109
use SimpleSAML\SAML2\XML\samlp\Response;
@@ -23,7 +22,6 @@
2322
* @package simplesamlphp/saml2
2423
*/
2524
#[Group('vulnerabilities')]
26-
#[CoversClass(ResponseProcessor::class)]
2725
final class GoldenSAMLResponseTest extends TestCase
2826
{
2927
/**

tests/SAML2/Response/XmlSignatureWrappingTest.php renamed to tests/Vulnerabilities/XmlSignatureWrappingTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace SimpleSAML\Test\SAML2\Response;
66

7+
use PHPUnit\Framework\Attributes\Group;
78
use PHPUnit\Framework\TestCase;
89
use Psr\Log\NullLogger;
910
use SimpleSAML\SAML2\Configuration\IdentityProvider;
@@ -16,6 +17,7 @@
1617
/**
1718
* @package simplesamlphp/saml2
1819
*/
20+
#[Group('vulnerabilities')]
1921
final class XmlSignatureWrappingTest extends TestCase
2022
{
2123
/** @var \SimpleSAML\SAML2\Signature\Validator */
@@ -66,7 +68,10 @@ public function testThatASignatureReferencingAnotherAssertionIsNotValid(): void
6668
*/
6769
private function getSignedAssertionWithSignatureThatReferencesAnotherAssertion(): Assertion
6870
{
69-
$document = DOMDocumentFactory::fromFile(__DIR__ . '/signedAssertionWithInvalidReferencedId.xml');
71+
$document = DOMDocumentFactory::fromFile(
72+
dirname(__DIR__, 1) . '/resources/xml/vulnerabilities/signedAssertionWithInvalidReferencedId.xml',
73+
);
74+
7075
/** @var \DOMElement $element */
7176
$element = $document->firstChild;
7277
return Assertion::fromXML($element);
@@ -78,7 +83,10 @@ private function getSignedAssertionWithSignatureThatReferencesAnotherAssertion()
7883
*/
7984
private function getSignedAssertionWithEmbeddedAssertionReferencedInSignature(): Assertion
8085
{
81-
$document = DOMDocumentFactory::fromFile(__DIR__ . '/signedAssertionReferencedEmbeddedAssertion.xml');
86+
$document = DOMDocumentFactory::fromFile(
87+
dirname(__DIR__, 1) . '/resources/xml/vulnerabilities/signedAssertionReferencedEmbeddedAssertion.xml',
88+
);
89+
8290
/** @var \DOMElement $element */
8391
$element = $document->firstChild;
8492
return Assertion::fromXML($element);

tests/SAML2/Response/signedAssertionReferencedEmbeddedAssertion.xml renamed to tests/resources/xml/vulnerabilities/signedAssertionReferencedEmbeddedAssertion.xml

File renamed without changes.

tests/SAML2/Response/signedAssertionWithInvalidReferencedId.xml renamed to tests/resources/xml/vulnerabilities/signedAssertionWithInvalidReferencedId.xml

File renamed without changes.

0 commit comments

Comments
 (0)