Skip to content

Commit

Permalink
WIP: Migrate phpunit metadata to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Mar 20, 2024
1 parent 0d76294 commit 8337ccd
Show file tree
Hide file tree
Showing 306 changed files with 700 additions and 262 deletions.
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/ClaimTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Test\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\Utils\XPath;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractClaimType;
use SimpleSAML\WSSecurity\XML\auth\ClaimType;
use SimpleSAML\WSSecurity\XML\auth\Description;
use SimpleSAML\WSSecurity\XML\auth\DisplayName;
Expand All @@ -23,11 +26,11 @@
/**
* Tests for auth:ClaimType.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\ClaimType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractClaimType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(ClaimType::class)]
#[CoversClass(AbstractClaimType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ClaimTypeTest extends TestCase
{
use SchemaValidationTestTrait;
Expand Down
16 changes: 10 additions & 6 deletions tests/WSSecurity/XML/auth/ConstrainedManyValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Assert\AssertionFailedException;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType;
use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\WSSecurity\XML\auth\Value;
use SimpleSAML\WSSecurity\XML\auth\ValueOneOf;
Expand All @@ -16,19 +20,20 @@
/**
* Tests for auth:ConstrainedManyValueType.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedManyValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(StructuredValue::class)]
#[CoversClass(ValueOneOf::class)]
#[CoversClass(AbstractConstrainedManyValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ConstrainedManyValueTest extends TestCase
{
/**
* Test creating an object from scratch.
*
* @param class-string $class
*
* @dataProvider classProvider
*/
#[DataProvider('classProvider')]
public function testMarshallingEmpty(string $class): void
{
$x = new $class([], []);
Expand All @@ -40,9 +45,8 @@ public function testMarshallingEmpty(string $class): void
* Test creating an object from scratch with both Value and StructuredValue.
*
* @param class-string $class
*
* @dataProvider classProvider
*/
#[DataProvider('classProvider')]
public function testMarshallingIllegalCombination(string $class): void
{
$attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1');
Expand Down
20 changes: 14 additions & 6 deletions tests/WSSecurity/XML/auth/ConstrainedSingleValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Assert\AssertionFailedException;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType;
use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\WSSecurity\XML\auth\Value;
use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan;
Expand All @@ -21,19 +25,24 @@
/**
* Tests for auth:ConstrainedSingleValueType.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(ValueGreaterThan::class)]
#[CoversClass(ValueGreaterThanOrEqual::class)]
#[CoversClass(ValueLessThan::class)]
#[CoversClass(ValueLessThanOrEqual::class)]
#[CoversClass(ValueLowerBound::class)]
#[CoversClass(ValueUpperBound::class)]
#[CoversClass(AbstractConstrainedSingleValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ConstrainedSingleValueTest extends TestCase
{
/**
* Test creating an object from scratch.
*
* @param class-string $class
*
* @dataProvider classProvider
*/
#[DataProvider('classProvider')]
public function testMarshallingEmpty(string $class): void
{
$x = new $class(null, null);
Expand All @@ -45,9 +54,8 @@ public function testMarshallingEmpty(string $class): void
* Test creating an object from scratch with both Value and StructuredValue.
*
* @param class-string $class
*
* @dataProvider classProvider
*/
#[DataProvider('classProvider')]
public function testMarshallingIllegalCombination(string $class): void
{
$attr1 = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1');
Expand Down
16 changes: 9 additions & 7 deletions tests/WSSecurity/XML/auth/ConstrainedValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedValueType;
use SimpleSAML\WSSecurity\XML\auth\ConstrainedValue;
//use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\WSSecurity\XML\auth\Value;
Expand All @@ -22,11 +26,11 @@
/**
* Tests for auth:ConstrainedValue.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\ConstrainedValue
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(ConstrainedValue::class)]
#[CoversClass(AbstractConstrainedValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ConstrainedValueTest extends TestCase
{
private static string $resourcePath;
Expand Down Expand Up @@ -64,11 +68,10 @@ public static function setUpBeforeClass(): void
/**
* Test creating a ConstrainedValue object from scratch.
*
* @dataProvider classProvider
*
* @param class-string $class
* @param string $xmlRepresentation
*/
#[DataProvider('classProvider')]
public function testMarshalling(string $class, string $xmlRepresentation): void
{
$xmlRepresentation = DOMDocumentFactory::fromFile(
Expand Down Expand Up @@ -101,11 +104,10 @@ public function testMarshalling(string $class, string $xmlRepresentation): void
/**
* Test creating a ConstrainedValue from XML.
*
* @dataProvider classProvider
*
* @param class-string $class
* @param string $xmlRepresentation
*/
#[DataProvider('classProvider')]
public function testUnmarshalling(string $class, string $xmlRepresentation): void
{
$xmlRepresentation = DOMDocumentFactory::fromFile(
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/DescriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractDescriptionType;
use SimpleSAML\WSSecurity\XML\auth\Description;
use SimpleSAML\XML\Attribute;
use SimpleSAML\XML\DOMDocumentFactory;
Expand All @@ -16,11 +19,11 @@
/**
* Tests for auth:Description.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\Description
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractDescriptionType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(Description::class)]
#[CoversClass(AbstractDescriptionType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class DescriptionTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/DisplayNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractDisplayNameType;
use SimpleSAML\WSSecurity\XML\auth\DisplayName;
use SimpleSAML\XML\Attribute;
use SimpleSAML\XML\DOMDocumentFactory;
Expand All @@ -16,11 +19,11 @@
/**
* Tests for auth:DisplayName.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\DisplayName
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractDisplayNameType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(DisplayName::class)]
#[CoversClass(AbstractDisplayNameType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class DisplayNameTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/DisplayValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractDisplayValueType;
use SimpleSAML\WSSecurity\XML\auth\DisplayValue;
use SimpleSAML\XML\Attribute;
use SimpleSAML\XML\DOMDocumentFactory;
Expand All @@ -16,11 +19,11 @@
/**
* Tests for auth:DisplayValue.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\DisplayValue
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractDisplayValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(DisplayValue::class)]
#[CoversClass(AbstractDisplayValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class DisplayValueTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/EncryptedValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractEncryptedValueType;
use SimpleSAML\WSSecurity\XML\auth\EncryptedValue;
use SimpleSAML\XML\DOMDocumentFactory;
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
Expand All @@ -21,11 +24,11 @@
/**
* Tests for auth:EncryptedValue.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\EncryptedValue
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractEncryptedValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(EncryptedValue::class)]
#[CoversClass(AbstractEncryptedValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class EncryptedValueTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/StructuredValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractStructuredValueType;
use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\XML\Attribute as XMLAttribute;
use SimpleSAML\XML\Chunk;
Expand All @@ -17,11 +20,11 @@
/**
* Tests for auth:StructuredValue.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\StructuredValue
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractStructuredValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(StructuredValue::class)]
#[CoversClass(AbstractStructuredValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class StructuredValueTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/ValueGreaterThanOrEqualTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType;
use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual;
use SimpleSAML\XML\Attribute as XMLAttribute;
Expand All @@ -18,11 +21,11 @@
/**
* Tests for auth:ValueGreaterThanOrEqual.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\ValueGreaterThanOrEqual
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(ValueGreaterThanOrEqual::class)]
#[CoversClass(AbstractConstrainedSingleValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ValueGreaterThanOrEqualTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/ValueGreaterThanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType;
use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan;
use SimpleSAML\XML\Attribute as XMLAttribute;
Expand All @@ -18,11 +21,11 @@
/**
* Tests for auth:ValueGreaterThan.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\ValueGreaterThan
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractConstrainedSingleValueType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(ValueGreaterThan::class)]
#[CoversClass(AbstractConstrainedSingleValueType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ValueGreaterThanTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
9 changes: 6 additions & 3 deletions tests/WSSecurity/XML/auth/ValueInRangenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace SimpleSAML\Test\WSSecurity\XML\auth;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement;
use SimpleSAML\WSSecurity\XML\auth\AbstractValueInRangeType;
use SimpleSAML\WSSecurity\XML\auth\StructuredValue;
use SimpleSAML\WSSecurity\XML\auth\Value;
use SimpleSAML\WSSecurity\XML\auth\ValueInRangen;
Expand All @@ -21,11 +24,11 @@
/**
* Tests for auth:ValueInRangen.
*
* @covers \SimpleSAML\WSSecurity\XML\auth\ValueInRangen
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractValueInRangeType
* @covers \SimpleSAML\WSSecurity\XML\auth\AbstractAuthElement
* @package simplesamlphp/ws-security
*/
#[CoversClass(ValueInRangen::class)]
#[CoversClass(AbstractValueInRangeType::class)]
#[CoversClass(AbstractAuthElement::class)]
final class ValueInRangenTest extends TestCase
{
use SerializableElementTestTrait;
Expand Down
Loading

0 comments on commit 8337ccd

Please sign in to comment.