Skip to content

Commit

Permalink
Migrate phpunit metadata to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Mar 19, 2024
1 parent 3ebbf83 commit 869a4bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"simplesamlphp/assert": "^1.1"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "^1.5"
"simplesamlphp/simplesamlphp-test-framework": "^1.6"
},
"support": {
"issues": "https://github.com/simplesamlphp/xml-common/issues",
Expand Down
4 changes: 2 additions & 2 deletions src/TestUtils/SchemaValidationTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use DOMDocument;
use Exception;
use LibXMLError; // Officially spelled with a lower-case `l`, but that breaks composer-require-checker
use PHPUnit\Framework\Attributes\Depends;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\SchemaViolationException;
use XMLReader;
Expand Down Expand Up @@ -37,9 +38,8 @@ trait SchemaValidationTestTrait

/**
* Test schema validation.
*
* @depends testSerialization
*/
#[Depends('testSerialization')]
public function testSchemaValidation(): void
{
if (!class_exists(self::$testedClass)) {
Expand Down
6 changes: 3 additions & 3 deletions src/TestUtils/SerializableElementTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace SimpleSAML\XML\TestUtils;

use DOMDocument;
use PHPUnit\Framework\Attributes\Depends;

use function class_exists;

Expand Down Expand Up @@ -56,10 +57,9 @@ public function testUnmarshalling(): void

/**
* Test serialization / unserialization.
*
* @depends testMarshalling
* @depends testUnmarshalling
*/
#[Depends('testMarshalling')]
#[Depends('testUnmarshalling')]
public function testSerialization(): void
{
if (!class_exists(self::$testedClass)) {
Expand Down
3 changes: 2 additions & 1 deletion tests/XML/Base64ElementTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SimpleSAML\Test\XML;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Test\XML\XMLDumper;
use SimpleSAML\XML\DOMDocumentFactory;
Expand Down Expand Up @@ -65,8 +66,8 @@ public function testUnmarshalling(): void

/**
* @param non-empty-string $xml
* @dataProvider provideBase64Cases
*/
#[DataProvider('provideBase64Cases')]
public function testBase64Cases(string $xml): void
{
$xmlRepresentation = DOMDocumentFactory::fromString($xml);
Expand Down

0 comments on commit 869a4bf

Please sign in to comment.