diff --git a/packages/core/src/Helpers/TranslatorTest.php b/packages/core/src/Helpers/TranslatorTest.php index f1c30fba2..00f6ba247 100644 --- a/packages/core/src/Helpers/TranslatorTest.php +++ b/packages/core/src/Helpers/TranslatorTest.php @@ -9,6 +9,7 @@ use LastDragon_ru\LaraASP\Core\Testing\Package\TestCase; use LastDragon_ru\LaraASP\Testing\Utils\WithTranslations; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,12 +21,11 @@ final class TranslatorTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderChoice - * * @param list|string $key * @param TranslationsFactory $translations * @param array $replace */ + #[DataProvider('dataProviderChoice')] public function testChoice( string $expected, mixed $translations, @@ -45,12 +45,11 @@ public function testChoice( } /** - * @dataProvider dataProviderGet - * * @param list|string $key * @param TranslationsFactory $translations * @param array $replace */ + #[DataProvider('dataProviderGet')] public function testGet( string $expected, mixed $translations, diff --git a/packages/core/src/Utils/ConfigMergerTest.php b/packages/core/src/Utils/ConfigMergerTest.php index 83783ebaf..711c20e7c 100644 --- a/packages/core/src/Utils/ConfigMergerTest.php +++ b/packages/core/src/Utils/ConfigMergerTest.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use LastDragon_ru\LaraASP\Core\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; /** @@ -16,12 +17,11 @@ final class ConfigMergerTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderMerge - * * @param array|Exception $expected * @param array $target * @param array $configs */ + #[DataProvider('dataProviderMerge')] public function testMerge( array|Exception $expected, array $target, diff --git a/packages/documentator/src/Preprocessor/Instructions/IncludeDocBlock/InstructionTest.php b/packages/documentator/src/Preprocessor/Instructions/IncludeDocBlock/InstructionTest.php index 7aec8abfb..a3c5c56a5 100644 --- a/packages/documentator/src/Preprocessor/Instructions/IncludeDocBlock/InstructionTest.php +++ b/packages/documentator/src/Preprocessor/Instructions/IncludeDocBlock/InstructionTest.php @@ -7,6 +7,7 @@ use LastDragon_ru\LaraASP\Documentator\Preprocessor\Exceptions\TargetIsNotValidPhpFile; use LastDragon_ru\LaraASP\Documentator\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function str_replace; @@ -17,9 +18,7 @@ final class InstructionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderProcess - */ + #[DataProvider('dataProviderProcess')] public function testProcess(Exception|string $expected, string $file, Parameters $params): void { $file = self::getTestData()->file($file); $instance = Container::getInstance()->make(Instruction::class); diff --git a/packages/documentator/src/Preprocessor/Instructions/IncludePackageList/InstructionTest.php b/packages/documentator/src/Preprocessor/Instructions/IncludePackageList/InstructionTest.php index d1277d011..ec2877b96 100644 --- a/packages/documentator/src/Preprocessor/Instructions/IncludePackageList/InstructionTest.php +++ b/packages/documentator/src/Preprocessor/Instructions/IncludePackageList/InstructionTest.php @@ -8,6 +8,7 @@ use LastDragon_ru\LaraASP\Documentator\Preprocessor\Exceptions\PackageReadmeIsMissing; use LastDragon_ru\LaraASP\Documentator\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function basename; @@ -18,9 +19,7 @@ final class InstructionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderProcess - */ + #[DataProvider('dataProviderProcess')] public function testProcess(string $expected, string $template): void { $path = self::getTestData()->file('Document.md')->getPathname(); $target = basename(self::getTestData()->path('/packages')); diff --git a/packages/documentator/src/Utils/ArtisanSerializerTest.php b/packages/documentator/src/Utils/ArtisanSerializerTest.php index 46664edef..1fdb7e9e8 100644 --- a/packages/documentator/src/Utils/ArtisanSerializerTest.php +++ b/packages/documentator/src/Utils/ArtisanSerializerTest.php @@ -5,6 +5,7 @@ use Illuminate\Console\Parser; use LastDragon_ru\LaraASP\Documentator\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; @@ -17,9 +18,7 @@ final class ArtisanSerializerTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderGetArgumentSignature - */ + #[DataProvider('dataProviderGetArgumentSignature')] public function testGetArgumentSignature(string $signature): void { $parsed = Parser::parse("command {{$signature}}")[1] ?? []; $argument = reset($parsed); @@ -28,9 +27,7 @@ public function testGetArgumentSignature(string $signature): void { self::assertEquals($signature, (new ArtisanSerializer())->getArgumentSignature($argument)); } - /** - * @dataProvider dataProviderGetOptionSignature - */ + #[DataProvider('dataProviderGetOptionSignature')] public function testGetOptionSignature(string $signature): void { $parsed = Parser::parse("command {{$signature}}")[2] ?? []; $option = reset($parsed); diff --git a/packages/eloquent/src/Iterators/ChunkedChangeSafeIteratorTest.php b/packages/eloquent/src/Iterators/ChunkedChangeSafeIteratorTest.php index 807c323e1..6300b044d 100644 --- a/packages/eloquent/src/Iterators/ChunkedChangeSafeIteratorTest.php +++ b/packages/eloquent/src/Iterators/ChunkedChangeSafeIteratorTest.php @@ -15,6 +15,7 @@ use Mockery; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function count; use function iterator_to_array; @@ -82,9 +83,7 @@ public function testGetIterator(): void { ->times(2); } - /** - * @dataProvider dataProviderGetIteratorColumn - */ + #[DataProvider('dataProviderGetIteratorColumn')] public function testGetIteratorDefaults(string $column): void { TestObject::factory()->create(['value' => '1']); TestObject::factory()->create(['value' => '2']); @@ -101,9 +100,7 @@ public function testGetIteratorDefaults(string $column): void { self::assertEquals($expected, $actual); } - /** - * @dataProvider dataProviderGetIteratorColumn - */ + #[DataProvider('dataProviderGetIteratorColumn')] public function testGetIteratorEloquentDefaults(string $column): void { TestObject::factory()->create(['value' => '1']); TestObject::factory()->create(['value' => '2']); @@ -127,10 +124,9 @@ public function testGetIteratorUnion(): void { } /** - * @dataProvider dataProviderGetDefaultColumn - * * @param Closure(): Builder $factory */ + #[DataProvider('dataProviderGetDefaultColumn')] public function testGetDefaultColumn(string $expected, Closure $factory): void { $iterator = new class() extends ChunkedChangeSafeIterator { /** @noinspection PhpMissingParentConstructorInspection */ diff --git a/packages/eloquent/src/Iterators/IteratorImplTest.php b/packages/eloquent/src/Iterators/IteratorImplTest.php index fd60d70ab..62dd9f19d 100644 --- a/packages/eloquent/src/Iterators/IteratorImplTest.php +++ b/packages/eloquent/src/Iterators/IteratorImplTest.php @@ -9,6 +9,7 @@ use Mockery; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -17,9 +18,7 @@ final class IteratorImplTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderCount - */ + #[DataProvider('dataProviderCount')] public function testCount(int $expected, ?int $limit, int $count): void { $query = Mockery::mock(QueryBuilder::class); $query diff --git a/packages/eloquent/src/ModelHelperTest.php b/packages/eloquent/src/ModelHelperTest.php index 797d356a9..da05687f5 100644 --- a/packages/eloquent/src/ModelHelperTest.php +++ b/packages/eloquent/src/ModelHelperTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use LastDragon_ru\LaraASP\Testing\Providers\UnknownValue; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use function is_string; @@ -27,11 +28,10 @@ final class ModelHelperTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderGetRelation - * * @param Exception|class-string $expected * @param Closure(): (Builder|Model|class-string) $model */ + #[DataProvider('dataProviderGetRelation')] public function testGetRelation(Exception|string $expected, Closure $model, string $name): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); @@ -45,11 +45,10 @@ public function testGetRelation(Exception|string $expected, Closure $model, stri } /** - * @dataProvider dataProviderGetRelation - * * @param Exception|class-string $expected * @param Closure(): (Builder|Model|class-string) $model */ + #[DataProvider('dataProviderGetRelation')] public function testIsRelation(Exception|string $expected, Closure $model, string $name): void { $actual = (new ModelHelper($model()))->isRelation($name); $expected = !($expected instanceof Exception); @@ -58,10 +57,9 @@ public function testIsRelation(Exception|string $expected, Closure $model, strin } /** - * @dataProvider dataProviderIsSoftDeletable - * * @param Closure(): (Builder|Model|class-string) $model */ + #[DataProvider('dataProviderIsSoftDeletable')] public function testIsSoftDeletable(bool $expected, Closure $model): void { $actual = (new ModelHelper($model()))->isSoftDeletable(); diff --git a/packages/formatter/src/Utils/DurationFormatterTest.php b/packages/formatter/src/Utils/DurationFormatterTest.php index a998bc4f2..e515a4e06 100644 --- a/packages/formatter/src/Utils/DurationFormatterTest.php +++ b/packages/formatter/src/Utils/DurationFormatterTest.php @@ -6,6 +6,7 @@ use DateTime; use LastDragon_ru\LaraASP\Formatter\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -14,16 +15,12 @@ final class DurationFormatterTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderGetTimestamp - */ + #[DataProvider('dataProviderGetTimestamp')] public function testGetTimestamp(float $expected, DateInterval $interval): void { self::assertEquals($expected, DurationFormatter::getTimestamp($interval)); } - /** - * @dataProvider dataProviderFormat - */ + #[DataProvider('dataProviderFormat')] public function testFormat(string $expected, string $format, float|int $duration): void { $formatter = new DurationFormatter($format); $actual = $formatter->format($duration); diff --git a/packages/formatter/src/Utils/UnicodeDateTimeFormatParserTest.php b/packages/formatter/src/Utils/UnicodeDateTimeFormatParserTest.php index b0650b6b0..8d9284b5d 100644 --- a/packages/formatter/src/Utils/UnicodeDateTimeFormatParserTest.php +++ b/packages/formatter/src/Utils/UnicodeDateTimeFormatParserTest.php @@ -4,6 +4,7 @@ use LastDragon_ru\LaraASP\Formatter\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function array_map; use function iterator_to_array; @@ -16,10 +17,9 @@ final class UnicodeDateTimeFormatParserTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderGetIterator - * * @param array $expected */ + #[DataProvider('dataProviderGetIterator')] public function testGetIterator(array $expected, string $format): void { $actual = iterator_to_array(new UnicodeDateTimeFormatParser($format)); $actual = array_map(static fn (UnicodeDateTimeFormatToken $token) => [$token->pattern, $token->value], $actual); diff --git a/packages/graphql-printer/src/Blocks/Document/ArgumentTest.php b/packages/graphql-printer/src/Blocks/Document/ArgumentTest.php index cd283d765..9f2797060 100644 --- a/packages/graphql-printer/src/Blocks/Document/ArgumentTest.php +++ b/packages/graphql-printer/src/Blocks/Document/ArgumentTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -21,9 +22,7 @@ final class ArgumentTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/DirectiveDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/DirectiveDefinitionTest.php index 43103c2c3..06466fc12 100644 --- a/packages/graphql-printer/src/Blocks/Document/DirectiveDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/DirectiveDefinitionTest.php @@ -14,6 +14,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -25,9 +26,7 @@ final class DirectiveDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/DirectiveTest.php b/packages/graphql-printer/src/Blocks/Document/DirectiveTest.php index 3b3184d25..77679720f 100644 --- a/packages/graphql-printer/src/Blocks/Document/DirectiveTest.php +++ b/packages/graphql-printer/src/Blocks/Document/DirectiveTest.php @@ -18,6 +18,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -26,9 +27,7 @@ final class DirectiveTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/DirectivesTest.php b/packages/graphql-printer/src/Blocks/Document/DirectivesTest.php index 80d56ee54..70326bf27 100644 --- a/packages/graphql-printer/src/Blocks/Document/DirectivesTest.php +++ b/packages/graphql-printer/src/Blocks/Document/DirectivesTest.php @@ -11,6 +11,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,10 +21,9 @@ final class DirectivesTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param list $directives */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/DocumentTest.php b/packages/graphql-printer/src/Blocks/Document/DocumentTest.php index b575d765a..dfdf56832 100644 --- a/packages/graphql-printer/src/Blocks/Document/DocumentTest.php +++ b/packages/graphql-printer/src/Blocks/Document/DocumentTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class DocumentTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/EnumTypeDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/EnumTypeDefinitionTest.php index 2f06a7de7..0f60bb18a 100644 --- a/packages/graphql-printer/src/Blocks/Document/EnumTypeDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/EnumTypeDefinitionTest.php @@ -11,6 +11,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class EnumTypeDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/EnumTypeExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/EnumTypeExtensionTest.php index a46360df5..80944adea 100644 --- a/packages/graphql-printer/src/Blocks/Document/EnumTypeExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/EnumTypeExtensionTest.php @@ -10,6 +10,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -19,9 +20,7 @@ final class EnumTypeExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/EnumValueDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/EnumValueDefinitionTest.php index 1c42e9a41..60ece3f3f 100644 --- a/packages/graphql-printer/src/Blocks/Document/EnumValueDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/EnumValueDefinitionTest.php @@ -11,6 +11,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -19,9 +20,7 @@ final class EnumValueDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/FieldDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/FieldDefinitionTest.php index 5c25ea447..7bb17ddae 100644 --- a/packages/graphql-printer/src/Blocks/Document/FieldDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/FieldDefinitionTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -24,9 +25,7 @@ final class FieldDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/FieldTest.php b/packages/graphql-printer/src/Blocks/Document/FieldTest.php index b08727fc2..ee449a058 100644 --- a/packages/graphql-printer/src/Blocks/Document/FieldTest.php +++ b/packages/graphql-printer/src/Blocks/Document/FieldTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -24,10 +25,9 @@ final class FieldTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param (TypeNode&Node)|Type|null $type */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/FragmentDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/FragmentDefinitionTest.php index 77300d902..dd04244cc 100644 --- a/packages/graphql-printer/src/Blocks/Document/FragmentDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/FragmentDefinitionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class FragmentDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, @@ -43,10 +42,9 @@ public function testSerialize( } /** - * @dataProvider dataProviderStatistics - * * @param array{types: array, directives: array} $expected */ + #[DataProvider('dataProviderStatistics')] public function testStatistics( array $expected, FragmentDefinitionNode $definition, diff --git a/packages/graphql-printer/src/Blocks/Document/FragmentSpreadTest.php b/packages/graphql-printer/src/Blocks/Document/FragmentSpreadTest.php index f8d3159a6..d05386189 100644 --- a/packages/graphql-printer/src/Blocks/Document/FragmentSpreadTest.php +++ b/packages/graphql-printer/src/Blocks/Document/FragmentSpreadTest.php @@ -16,6 +16,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -25,10 +26,9 @@ final class FragmentSpreadTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param (TypeNode&Node)|Type|null $type */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, @@ -50,11 +50,10 @@ public function testSerialize( } /** - * @dataProvider dataProviderStatistics - * * @param array{types: array, directives: array} $expected * @param (TypeNode&Node)|Type|null $type */ + #[DataProvider('dataProviderStatistics')] public function testStatistics( array $expected, FragmentSpreadNode $definition, diff --git a/packages/graphql-printer/src/Blocks/Document/InlineFragmentTest.php b/packages/graphql-printer/src/Blocks/Document/InlineFragmentTest.php index 6a46daa9f..8a3d60ce5 100644 --- a/packages/graphql-printer/src/Blocks/Document/InlineFragmentTest.php +++ b/packages/graphql-printer/src/Blocks/Document/InlineFragmentTest.php @@ -16,6 +16,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -25,10 +26,9 @@ final class InlineFragmentTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param (TypeNode&Node)|Type|null $type */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, @@ -50,11 +50,10 @@ public function testSerialize( } /** - * @dataProvider dataProviderStatistics - * * @param array{types: array, directives: array} $expected * @param (TypeNode&Node)|Type|null $type */ + #[DataProvider('dataProviderStatistics')] public function testStatistics( array $expected, InlineFragmentNode $definition, diff --git a/packages/graphql-printer/src/Blocks/Document/InputObjectTypeDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/InputObjectTypeDefinitionTest.php index 87b39a170..0982fa8af 100644 --- a/packages/graphql-printer/src/Blocks/Document/InputObjectTypeDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/InputObjectTypeDefinitionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -21,9 +22,7 @@ final class InputObjectTypeDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/InputObjectTypeExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/InputObjectTypeExtensionTest.php index 306b4091c..ed04bf212 100644 --- a/packages/graphql-printer/src/Blocks/Document/InputObjectTypeExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/InputObjectTypeExtensionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -21,9 +22,7 @@ final class InputObjectTypeExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/InputValueDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/InputValueDefinitionTest.php index 33acb4dce..116e21040 100644 --- a/packages/graphql-printer/src/Blocks/Document/InputValueDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/InputValueDefinitionTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -23,9 +24,7 @@ final class InputValueDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/InterfaceTypeDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/InterfaceTypeDefinitionTest.php index b02769243..5d61846b0 100644 --- a/packages/graphql-printer/src/Blocks/Document/InterfaceTypeDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/InterfaceTypeDefinitionTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -21,9 +22,7 @@ final class InterfaceTypeDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/InterfaceTypeExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/InterfaceTypeExtensionTest.php index e096086f6..cf13257ea 100644 --- a/packages/graphql-printer/src/Blocks/Document/InterfaceTypeExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/InterfaceTypeExtensionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class InterfaceTypeExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/ObjectTypeDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/ObjectTypeDefinitionTest.php index f074718db..fc8620513 100644 --- a/packages/graphql-printer/src/Blocks/Document/ObjectTypeDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/ObjectTypeDefinitionTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -21,9 +22,7 @@ final class ObjectTypeDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/ObjectTypeExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/ObjectTypeExtensionTest.php index fb5ad8d24..9fd8a770f 100644 --- a/packages/graphql-printer/src/Blocks/Document/ObjectTypeExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/ObjectTypeExtensionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class ObjectTypeExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/OperationDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/OperationDefinitionTest.php index 80176b32d..2eb80ec62 100644 --- a/packages/graphql-printer/src/Blocks/Document/OperationDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/OperationDefinitionTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -24,10 +25,9 @@ final class OperationDefinitionTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param (TypeNode&Node)|Type|null $type */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/ScalarTypeDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/ScalarTypeDefinitionTest.php index 34bbb76c4..2be371720 100644 --- a/packages/graphql-printer/src/Blocks/Document/ScalarTypeDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/ScalarTypeDefinitionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class ScalarTypeDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/ScalarTypeExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/ScalarTypeExtensionTest.php index f029dd7c1..d11d85c63 100644 --- a/packages/graphql-printer/src/Blocks/Document/ScalarTypeExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/ScalarTypeExtensionTest.php @@ -10,6 +10,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -18,9 +19,7 @@ final class ScalarTypeExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/SchemaDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/SchemaDefinitionTest.php index a9b78f71f..4285a6a02 100644 --- a/packages/graphql-printer/src/Blocks/Document/SchemaDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/SchemaDefinitionTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function str_starts_with; @@ -25,9 +26,7 @@ final class SchemaDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/SchemaExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/SchemaExtensionTest.php index 767878317..00fd75d92 100644 --- a/packages/graphql-printer/src/Blocks/Document/SchemaExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/SchemaExtensionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -22,9 +23,7 @@ final class SchemaExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/TypeTest.php b/packages/graphql-printer/src/Blocks/Document/TypeTest.php index f4fcbdb32..7fd84744c 100644 --- a/packages/graphql-printer/src/Blocks/Document/TypeTest.php +++ b/packages/graphql-printer/src/Blocks/Document/TypeTest.php @@ -19,6 +19,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -28,10 +29,9 @@ final class TypeTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param (TypeNode&Node)|(GraphQLType&(OutputType|InputType)) $type */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/UnionTypeDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/UnionTypeDefinitionTest.php index abe307021..bfa8786ce 100644 --- a/packages/graphql-printer/src/Blocks/Document/UnionTypeDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/UnionTypeDefinitionTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -22,9 +23,7 @@ final class UnionTypeDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/UnionTypeExtensionTest.php b/packages/graphql-printer/src/Blocks/Document/UnionTypeExtensionTest.php index 9e359bfa1..6953b752e 100644 --- a/packages/graphql-printer/src/Blocks/Document/UnionTypeExtensionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/UnionTypeExtensionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -21,9 +22,7 @@ final class UnionTypeExtensionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/ValueTest.php b/packages/graphql-printer/src/Blocks/Document/ValueTest.php index eb551aa1e..3648ee14f 100644 --- a/packages/graphql-printer/src/Blocks/Document/ValueTest.php +++ b/packages/graphql-printer/src/Blocks/Document/ValueTest.php @@ -26,6 +26,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function assert; @@ -37,10 +38,9 @@ final class ValueTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param ValueNode&Node $node */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Document/VariableDefinitionTest.php b/packages/graphql-printer/src/Blocks/Document/VariableDefinitionTest.php index d9eb511f1..1052e9512 100644 --- a/packages/graphql-printer/src/Blocks/Document/VariableDefinitionTest.php +++ b/packages/graphql-printer/src/Blocks/Document/VariableDefinitionTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class VariableDefinitionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/ListBlockTest.php b/packages/graphql-printer/src/Blocks/ListBlockTest.php index 2d9050d93..335dbd82d 100644 --- a/packages/graphql-printer/src/Blocks/ListBlockTest.php +++ b/packages/graphql-printer/src/Blocks/ListBlockTest.php @@ -11,6 +11,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\MergeDataProvider; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function assert; @@ -22,10 +23,9 @@ final class ListBlockTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSerialize - * * @param array $blocks */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Types/DescriptionBlockTest.php b/packages/graphql-printer/src/Blocks/Types/DescriptionBlockTest.php index 94094328b..6223e294d 100644 --- a/packages/graphql-printer/src/Blocks/Types/DescriptionBlockTest.php +++ b/packages/graphql-printer/src/Blocks/Types/DescriptionBlockTest.php @@ -9,6 +9,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -19,9 +20,7 @@ final class DescriptionBlockTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/Blocks/Values/StringValueTest.php b/packages/graphql-printer/src/Blocks/Values/StringValueTest.php index a03135256..b8bc670cb 100644 --- a/packages/graphql-printer/src/Blocks/Values/StringValueTest.php +++ b/packages/graphql-printer/src/Blocks/Values/StringValueTest.php @@ -10,6 +10,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -20,9 +21,7 @@ final class StringValueTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize( string $expected, Settings $settings, diff --git a/packages/graphql-printer/src/IntrospectionPrinterTest.php b/packages/graphql-printer/src/IntrospectionPrinterTest.php index ca66f9ea8..17620bd72 100644 --- a/packages/graphql-printer/src/IntrospectionPrinterTest.php +++ b/packages/graphql-printer/src/IntrospectionPrinterTest.php @@ -8,6 +8,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -16,9 +17,7 @@ final class IntrospectionPrinterTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPrint - */ + #[DataProvider('dataProviderPrint')] public function testPrint(string $expected, Settings $settings, int $level): void { $expected = self::getTestData()->content($expected); $printer = (new IntrospectionPrinter())->setSettings($settings); diff --git a/packages/graphql-printer/src/PrinterTest.php b/packages/graphql-printer/src/PrinterTest.php index d81c275e4..9de46d541 100644 --- a/packages/graphql-printer/src/PrinterTest.php +++ b/packages/graphql-printer/src/PrinterTest.php @@ -25,6 +25,7 @@ use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\Package\TestCase; use LastDragon_ru\LaraASP\GraphQLPrinter\Testing\TestSettings; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function str_ends_with; @@ -37,15 +38,15 @@ final class PrinterTest extends TestCase { // // ========================================================================= + /** - * @dataProvider dataProviderPrintSchema - * @dataProvider dataProviderPrintType - * @dataProvider dataProviderPrintNode - * * @param Closure(static): ?Schema $schemaFactory * @param Closure(static, ?Schema): (Node|Type|Directive|FieldDefinition|Argument|EnumValueDefinition|InputObjectField|Schema) $printableFactory * @param Closure(static, ?Schema): ((TypeNode&Node)|Type|null)|null $typeFactory */ + #[DataProvider('dataProviderPrintSchema')] + #[DataProvider('dataProviderPrintType')] + #[DataProvider('dataProviderPrintNode')] public function testPrint( GraphQLExpected $expected, ?Settings $settings, @@ -67,16 +68,14 @@ public function testPrint( $printable->assertValid(); } } - /** - * @dataProvider dataProviderPrintSchema - * @dataProvider dataProviderExportType - * @dataProvider dataProviderExportNode - * * @param Closure(static): ?Schema $schemaFactory * @param Closure(static, ?Schema): (Node|Type|Directive|FieldDefinition|Argument|EnumValueDefinition|InputObjectField|Schema) $exportableFactory * @param Closure(static, ?Schema): ((TypeNode&Node)|Type|null)|null $typeFactory */ + #[DataProvider('dataProviderPrintSchema')] + #[DataProvider('dataProviderExportType')] + #[DataProvider('dataProviderExportNode')] public function testExport( GraphQLExpected $expected, ?Settings $settings, diff --git a/packages/graphql/src/Builder/BuilderInfoDetectorTest.php b/packages/graphql/src/Builder/BuilderInfoDetectorTest.php index e5877fd45..260aba5d9 100644 --- a/packages/graphql/src/Builder/BuilderInfoDetectorTest.php +++ b/packages/graphql/src/Builder/BuilderInfoDetectorTest.php @@ -35,6 +35,7 @@ use Nuwave\Lighthouse\Support\Contracts\Directive; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function json_encode; @@ -52,11 +53,11 @@ final class BuilderInfoDetectorTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderGetNodeBuilderInfo * * @param array{name: string, builder: string} $expected * @param Closure(DirectiveLocator, AstManipulator): (InterfaceFieldArgumentSource|ObjectFieldArgumentSource|ObjectFieldSource|InterfaceFieldSource) $sourceFactory */ + #[DataProvider('dataProviderGetNodeBuilderInfo')] public function testGetNodeBuilderInfo(array $expected, Closure $sourceFactory): void { $manipulator = $this->getAstManipulator(Mockery::mock(DocumentAST::class)); $locator = Container::getInstance()->make(DirectiveLocator::class); @@ -74,11 +75,10 @@ public function testGetNodeBuilderInfo(array $expected, Closure $sourceFactory): } /** - * @dataProvider dataProviderGetNodeBuilderInfoScoutBuilder - * * @param array{name: string, builder: string} $expected * @param Closure(DirectiveLocator, AstManipulator): (InterfaceFieldArgumentSource|ObjectFieldArgumentSource|ObjectFieldSource|InterfaceFieldSource) $sourceFactory */ + #[DataProvider('dataProviderGetNodeBuilderInfoScoutBuilder')] #[RequiresLaravelScout] public function testGetNodeBuilderInfoScoutBuilder(array $expected, Closure $sourceFactory): void { $manipulator = $this->getAstManipulator(Mockery::mock(DocumentAST::class)); diff --git a/packages/graphql/src/Builder/Directives/SchemaDirectiveTest.php b/packages/graphql/src/Builder/Directives/SchemaDirectiveTest.php index ff8e8f1c2..6f603530f 100644 --- a/packages/graphql/src/Builder/Directives/SchemaDirectiveTest.php +++ b/packages/graphql/src/Builder/Directives/SchemaDirectiveTest.php @@ -18,6 +18,7 @@ use Nuwave\Lighthouse\Schema\AST\DocumentAST; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function is_string; @@ -46,9 +47,7 @@ class: {$class} self::assertGraphQLPrintableEquals($expected, $actual); } - /** - * @dataProvider dataProviderManipulateTypeDefinition - */ + #[DataProvider('dataProviderManipulateTypeDefinition')] public function testManipulateTypeDefinition(Exception|string $expected, string $schema, string $type): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/graphql/src/Builder/Types/InputObjectTest.php b/packages/graphql/src/Builder/Types/InputObjectTest.php index d321e6688..3b57d250a 100644 --- a/packages/graphql/src/Builder/Types/InputObjectTest.php +++ b/packages/graphql/src/Builder/Types/InputObjectTest.php @@ -27,6 +27,7 @@ use Nuwave\Lighthouse\Support\Contracts\Directive; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -36,10 +37,9 @@ final class InputObjectTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderIsFieldDirectiveAllowed - * * @param list|null $allowed */ + #[DataProvider('dataProviderIsFieldDirectiveAllowed')] public function testIsFieldDirectiveAllowed( bool $expected, ?array $allowed, diff --git a/packages/graphql/src/Printer/PrinterTest.php b/packages/graphql/src/Printer/PrinterTest.php index 9e3ac4e60..52ab03194 100644 --- a/packages/graphql/src/Printer/PrinterTest.php +++ b/packages/graphql/src/Printer/PrinterTest.php @@ -33,6 +33,7 @@ use Nuwave\Lighthouse\Schema\TypeRegistry; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use SplFileInfo; use function in_array; @@ -48,14 +49,13 @@ final class PrinterTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderPrintSchema - * @dataProvider dataProviderPrintType - * @dataProvider dataProviderPrintNode - * * @param Closure(static): (Schema|SplFileInfo|string) $schemaFactory * @param Closure(static, Schema): (Node|Type|Directive|FieldDefinition|Argument|EnumValueDefinition|InputObjectField|Schema) $printableFactory * @param Closure(static, Schema): ((TypeNode&Node)|Type|null)|null $typeFactory */ + #[DataProvider('dataProviderPrintSchema')] + #[DataProvider('dataProviderPrintType')] + #[DataProvider('dataProviderPrintNode')] public function testPrint( GraphQLExpected $expected, ?Settings $settings, @@ -76,14 +76,13 @@ public function testPrint( } /** - * @dataProvider dataProviderPrintSchema - * @dataProvider dataProviderExportType - * @dataProvider dataProviderExportNode - * * @param Closure(static): (Schema|SplFileInfo|string) $schemaFactory * @param Closure(static, Schema): (Node|Type|Directive|FieldDefinition|Argument|EnumValueDefinition|InputObjectField|Schema) $exportableFactory * @param Closure(static, Schema): ((TypeNode&Node)|Type|null)|null $typeFactory */ + #[DataProvider('dataProviderPrintSchema')] + #[DataProvider('dataProviderExportType')] + #[DataProvider('dataProviderExportNode')] public function testExport( GraphQLExpected $expected, ?Settings $settings, diff --git a/packages/graphql/src/Scalars/JsonStringTypeTest.php b/packages/graphql/src/Scalars/JsonStringTypeTest.php index 8f67cb720..c91b14099 100644 --- a/packages/graphql/src/Scalars/JsonStringTypeTest.php +++ b/packages/graphql/src/Scalars/JsonStringTypeTest.php @@ -12,6 +12,7 @@ use LastDragon_ru\LaraASP\GraphQL\Testing\Package\TestCase; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -20,9 +21,7 @@ final class JsonStringTypeTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize(?Exception $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); @@ -38,9 +37,7 @@ public function testSerialize(?Exception $expected, mixed $value): void { } } - /** - * @dataProvider dataProviderParseValue - */ + #[DataProvider('dataProviderParseValue')] public function testParseValue(?Exception $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); @@ -53,9 +50,7 @@ public function testParseValue(?Exception $expected, mixed $value): void { self::assertEquals($value, $actual); } - /** - * @dataProvider dataProviderParseLiteral - */ + #[DataProvider('dataProviderParseLiteral')] public function testParseLiteral(?Exception $expected, Node&ValueNode $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/graphql/src/SearchBy/Directives/DirectiveTest.php b/packages/graphql/src/SearchBy/Directives/DirectiveTest.php index b5d37d9d2..36cb7b47b 100644 --- a/packages/graphql/src/SearchBy/Directives/DirectiveTest.php +++ b/packages/graphql/src/SearchBy/Directives/DirectiveTest.php @@ -68,6 +68,7 @@ use Nuwave\Lighthouse\Testing\MakesGraphQLRequests; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function array_merge; use function implode; @@ -100,10 +101,9 @@ protected function getPackageProviders(mixed $app): array { // // ========================================================================= /** - * @dataProvider dataProviderManipulateArgDefinition - * * @param Closure(static): void|null $prepare */ + #[DataProvider('dataProviderManipulateArgDefinition')] public function testManipulateArgDefinition(string $expected, string $graphql, ?Closure $prepare = null): void { if ($prepare) { $prepare($this); @@ -196,11 +196,10 @@ public function testManipulateArgDefinitionUnknownType(): void { } /** - * @dataProvider dataProviderHandleBuilder - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): object $builderFactory */ + #[DataProvider('dataProviderHandleBuilder')] public function testDirective( array|Exception $expected, Closure $builderFactory, @@ -249,11 +248,10 @@ public function testDirective( /** * @deprecated 5.5.0 * - * @dataProvider dataProviderHandleBuilderV5Compat - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): object $builderFactory */ + #[DataProvider('dataProviderHandleBuilderV5Compat')] public function testDirectiveV5Compat( array|Exception $expected, Closure $builderFactory, @@ -303,11 +301,10 @@ public function testDirectiveV5Compat( } /** - * @dataProvider dataProviderHandleBuilder - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): (QueryBuilder|EloquentBuilder) $builderFactory */ + #[DataProvider('dataProviderHandleBuilder')] public function testHandleBuilder( array|Exception $expected, Closure $builderFactory, @@ -357,11 +354,10 @@ public function testHandleBuilder( /** * @deprecated 5.5.0 * - * @dataProvider dataProviderHandleBuilderV5Compat - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): (QueryBuilder|EloquentBuilder) $builderFactory */ + #[DataProvider('dataProviderHandleBuilderV5Compat')] public function testHandleBuilderV5Compat( array|Exception $expected, Closure $builderFactory, @@ -412,13 +408,12 @@ public function testHandleBuilderV5Compat( } /** - * @dataProvider dataProviderHandleScoutBuilder - * * @param array|Exception $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderHandleScoutBuilder')] #[RequiresLaravelScout] public function testHandleScoutBuilder( array|Exception $expected, @@ -488,13 +483,12 @@ static function (MockInterface $mock) use ($resolver): void { /** * @deprecated 5.5.0 * - * @dataProvider dataProviderHandleScoutBuilderV5Compat - * * @param array|Exception $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderHandleScoutBuilderV5Compat')] #[RequiresLaravelScout] public function testHandleScoutBuilderV5Compat( array|Exception $expected, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/BetweenTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/BetweenTest.php index 3e6e8fe51..1b51a9e09 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/BetweenTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/BetweenTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class BetweenTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseAndTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseAndTest.php index f752665a1..158bd7e5e 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseAndTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseAndTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class BitwiseAndTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseLeftShiftTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseLeftShiftTest.php index 1bf33e83f..156eae8a6 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseLeftShiftTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseLeftShiftTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class BitwiseLeftShiftTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseOrTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseOrTest.php index 2e4407bac..43a2772ff 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseOrTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseOrTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class BitwiseOrTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseRightShiftTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseRightShiftTest.php index dbd1ce272..8cf7be38e 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseRightShiftTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseRightShiftTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class BitwiseRightShiftTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseXorTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseXorTest.php index 4ed32463c..4c908ed64 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseXorTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/BitwiseXorTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class BitwiseXorTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/ContainsTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/ContainsTest.php index b3a70ad72..24078ea37 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/ContainsTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/ContainsTest.php @@ -19,6 +19,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -34,8 +35,6 @@ final class ContainsTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param class-string $grammar @@ -43,6 +42,7 @@ final class ContainsTest extends TestCase { * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/EndsWithTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/EndsWithTest.php index 445c86196..ead7e63e4 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/EndsWithTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/EndsWithTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class EndsWithTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/EqualTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/EqualTest.php index f099768de..60dcf39cd 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/EqualTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/EqualTest.php @@ -20,6 +20,7 @@ use Nuwave\Lighthouse\Execution\Arguments\Argument; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -35,14 +36,13 @@ final class EqualTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, @@ -63,8 +63,6 @@ public function testCall( } /** - * @dataProvider dataProviderCallScout - * * @param array $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(static): Argument $argumentFactory @@ -72,6 +70,7 @@ public function testCall( * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderCallScout')] #[RequiresLaravelScout] public function testCallScoutBuilder( array $expected, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanOrEqualTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanOrEqualTest.php index 4a4df0f61..d892fd6dc 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanOrEqualTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanOrEqualTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class GreaterThanOrEqualTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanTest.php index 401c17424..44980d535 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/GreaterThanTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class GreaterThanTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/InTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/InTest.php index ba4888418..fb7bc8411 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/InTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/InTest.php @@ -20,6 +20,7 @@ use Nuwave\Lighthouse\Execution\Arguments\Argument; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -35,14 +36,13 @@ final class InTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, @@ -63,8 +63,6 @@ public function testCall( } /** - * @dataProvider dataProviderCallScout - * * @param array $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(static): Argument $argumentFactory @@ -72,6 +70,7 @@ public function testCall( * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderCallScout')] #[RequiresLaravelScout] public function testCallScoutBuilder( array $expected, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/IsNotNullTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/IsNotNullTest.php index e73ac7d97..4c451c27c 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/IsNotNullTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/IsNotNullTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class IsNotNullTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/IsNullTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/IsNullTest.php index 8a5b5403f..487d0d776 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/IsNullTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/IsNullTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class IsNullTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/LessThanOrEqualTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/LessThanOrEqualTest.php index cdd36b32e..130e994d1 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/LessThanOrEqualTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/LessThanOrEqualTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class LessThanOrEqualTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/LessThanTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/LessThanTest.php index ecf51c826..af6ff4f39 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/LessThanTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/LessThanTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class LessThanTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/LikeTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/LikeTest.php index 653d87e48..68212ebc5 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/LikeTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/LikeTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class LikeTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotBetweenTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotBetweenTest.php index 0a48bdd6a..301205145 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotBetweenTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotBetweenTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class NotBetweenTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotContainsTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotContainsTest.php index 1dd1d7acc..766030bdc 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotContainsTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotContainsTest.php @@ -19,6 +19,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -34,8 +35,6 @@ final class NotContainsTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param class-string $grammar @@ -43,6 +42,7 @@ final class NotContainsTest extends TestCase { * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotEndsWithTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotEndsWithTest.php index 4e96328ae..06d88930f 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotEndsWithTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotEndsWithTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class NotEndsWithTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotEqualTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotEqualTest.php index 564759b67..76f32a58a 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotEqualTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotEqualTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class NotEqualTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotInTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotInTest.php index f8cef4969..46bd0c017 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotInTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotInTest.php @@ -22,6 +22,7 @@ use Nuwave\Lighthouse\Execution\Arguments\Argument; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; use function sprintf; @@ -38,14 +39,13 @@ final class NotInTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, @@ -66,8 +66,6 @@ public function testCall( } /** - * @dataProvider dataProviderCallScout - * * @param array $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(static): Argument $argumentFactory @@ -75,6 +73,7 @@ public function testCall( * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderCallScout')] #[RequiresLaravelScout] public function testCallScoutBuilder( array $expected, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotLikeTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotLikeTest.php index e070a0649..990cedfd1 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotLikeTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotLikeTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class NotLikeTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/NotStartsWithTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/NotStartsWithTest.php index ff3364ef1..a4ce7fbd6 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/NotStartsWithTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/NotStartsWithTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class NotStartsWithTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Comparison/StartsWithTest.php b/packages/graphql/src/SearchBy/Operators/Comparison/StartsWithTest.php index e616b1c4c..31a0a57b7 100644 --- a/packages/graphql/src/SearchBy/Operators/Comparison/StartsWithTest.php +++ b/packages/graphql/src/SearchBy/Operators/Comparison/StartsWithTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -28,14 +29,13 @@ final class StartsWithTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Complex/RelationshipTest.php b/packages/graphql/src/SearchBy/Operators/Complex/RelationshipTest.php index 653617ce8..a557ceb18 100644 --- a/packages/graphql/src/SearchBy/Operators/Complex/RelationshipTest.php +++ b/packages/graphql/src/SearchBy/Operators/Complex/RelationshipTest.php @@ -16,6 +16,7 @@ use LastDragon_ru\LaraASP\GraphQL\Testing\Package\TestCase; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -31,14 +32,13 @@ final class RelationshipTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array}|Exception $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array|Exception $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Logical/AllOfTest.php b/packages/graphql/src/SearchBy/Operators/Logical/AllOfTest.php index 8253c9cb3..dcbd76c22 100644 --- a/packages/graphql/src/SearchBy/Operators/Logical/AllOfTest.php +++ b/packages/graphql/src/SearchBy/Operators/Logical/AllOfTest.php @@ -22,6 +22,7 @@ use Nuwave\Lighthouse\Execution\Arguments\Argument; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -37,14 +38,13 @@ final class AllOfTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, @@ -65,8 +65,6 @@ public function testCall( } /** - * @dataProvider dataProviderCallScout - * * @param array $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(static): Argument $argumentFactory @@ -74,6 +72,7 @@ public function testCall( * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderCallScout')] #[RequiresLaravelScout] public function testCallScoutBuilder( array $expected, diff --git a/packages/graphql/src/SearchBy/Operators/Logical/AnyOfTest.php b/packages/graphql/src/SearchBy/Operators/Logical/AnyOfTest.php index 29a629bf4..cf015dc21 100644 --- a/packages/graphql/src/SearchBy/Operators/Logical/AnyOfTest.php +++ b/packages/graphql/src/SearchBy/Operators/Logical/AnyOfTest.php @@ -16,6 +16,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\MergeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -31,14 +32,13 @@ final class AnyOfTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SearchBy/Operators/Logical/NotTest.php b/packages/graphql/src/SearchBy/Operators/Logical/NotTest.php index 48bc69eba..a1e3c5954 100644 --- a/packages/graphql/src/SearchBy/Operators/Logical/NotTest.php +++ b/packages/graphql/src/SearchBy/Operators/Logical/NotTest.php @@ -16,6 +16,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\MergeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -31,14 +32,13 @@ final class NotTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SortBy/Directives/DirectiveTest.php b/packages/graphql/src/SortBy/Directives/DirectiveTest.php index f319bd3f2..5cccc4e74 100644 --- a/packages/graphql/src/SortBy/Directives/DirectiveTest.php +++ b/packages/graphql/src/SortBy/Directives/DirectiveTest.php @@ -53,6 +53,7 @@ use Nuwave\Lighthouse\Testing\MakesGraphQLRequests; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function array_merge; use function implode; @@ -85,10 +86,9 @@ protected function getPackageProviders(mixed $app): array { // // ========================================================================= /** - * @dataProvider dataProviderManipulateArgDefinition - * * @param Closure(static): void|null $prepare */ + #[DataProvider('dataProviderManipulateArgDefinition')] public function testManipulateArgDefinition(string $expected, string $graphql, ?Closure $prepare = null): void { if ($prepare) { $prepare($this); @@ -182,12 +182,11 @@ public function testManipulateArgDefinitionTypeRegistryEmpty(): void { } /** - * @dataProvider dataProviderHandleBuilder - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): object $builderFactory * @param Closure(static): void|null $prepare */ + #[DataProvider('dataProviderHandleBuilder')] public function testDirective( array|Exception $expected, Closure $builderFactory, @@ -241,12 +240,11 @@ public function testDirective( /** * @deprecated 5.5.0 * - * @dataProvider dataProviderHandleBuilderV5Compat - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): object $builderFactory * @param Closure(static): void|null $prepare */ + #[DataProvider('dataProviderHandleBuilderV5Compat')] public function testDirectiveV5Compat( array|Exception $expected, Closure $builderFactory, @@ -301,12 +299,11 @@ public function testDirectiveV5Compat( } /** - * @dataProvider dataProviderHandleBuilder - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): (QueryBuilder|EloquentBuilder) $builderFactory * @param Closure(static): void|null $prepare */ + #[DataProvider('dataProviderHandleBuilder')] public function testHandleBuilder( array|Exception $expected, Closure $builderFactory, @@ -361,12 +358,11 @@ public function testHandleBuilder( /** * @deprecated 5.5.0 * - * @dataProvider dataProviderHandleBuilderV5Compat - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): (QueryBuilder|EloquentBuilder) $builderFactory * @param Closure(static): void|null $prepare */ + #[DataProvider('dataProviderHandleBuilderV5Compat')] public function testHandleBuilderV5Compat( array|Exception $expected, Closure $builderFactory, @@ -422,13 +418,12 @@ public function testHandleBuilderV5Compat( } /** - * @dataProvider dataProviderHandleScoutBuilder - * * @param array|Exception $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderHandleScoutBuilder')] #[RequiresLaravelScout] public function testHandleScoutBuilder( array|Exception $expected, @@ -498,13 +493,12 @@ static function (MockInterface $mock) use ($resolver): void { /** * @deprecated 5.5.0 * - * @dataProvider dataProviderHandleScoutBuilderV5Compat - * * @param array|Exception $expected * @param Closure(static): ScoutBuilder $builderFactory * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderHandleScoutBuilderV5Compat')] #[RequiresLaravelScout] public function testHandleScoutBuilderV5Compat( array|Exception $expected, diff --git a/packages/graphql/src/SortBy/Operators/Extra/NullsFirstTest.php b/packages/graphql/src/SortBy/Operators/Extra/NullsFirstTest.php index c671dd857..5def4de2c 100644 --- a/packages/graphql/src/SortBy/Operators/Extra/NullsFirstTest.php +++ b/packages/graphql/src/SortBy/Operators/Extra/NullsFirstTest.php @@ -14,6 +14,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -29,14 +30,13 @@ final class NullsFirstTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SortBy/Operators/Extra/NullsLastTest.php b/packages/graphql/src/SortBy/Operators/Extra/NullsLastTest.php index 2a4bbe6da..c9db3663d 100644 --- a/packages/graphql/src/SortBy/Operators/Extra/NullsLastTest.php +++ b/packages/graphql/src/SortBy/Operators/Extra/NullsLastTest.php @@ -14,6 +14,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -29,14 +30,13 @@ final class NullsLastTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SortBy/Operators/Extra/RandomTest.php b/packages/graphql/src/SortBy/Operators/Extra/RandomTest.php index 6e77b7b2c..88b17b30f 100644 --- a/packages/graphql/src/SortBy/Operators/Extra/RandomTest.php +++ b/packages/graphql/src/SortBy/Operators/Extra/RandomTest.php @@ -13,6 +13,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Nuwave\Lighthouse\Execution\Arguments\Argument; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -26,14 +27,13 @@ final class RandomTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SortBy/Operators/SortTest.php b/packages/graphql/src/SortBy/Operators/SortTest.php index bb0452b10..74129a698 100644 --- a/packages/graphql/src/SortBy/Operators/SortTest.php +++ b/packages/graphql/src/SortBy/Operators/SortTest.php @@ -29,6 +29,7 @@ use Nuwave\Lighthouse\Execution\Arguments\Argument; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; @@ -44,14 +45,13 @@ final class SortTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderCall - * * @param array{query: string, bindings: array} $expected * @param BuilderFactory $builderFactory * @param Closure(static): Argument $argumentFactory * @param Closure(static): Context|null $contextFactory * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderCall')] public function testCall( array $expected, Closure $builderFactory, @@ -154,12 +154,11 @@ public function testCallScoutBuilder(): void { } /** - * @dataProvider dataProviderGetNulls - * * @param array $config * @param Closure(static): Sorter $sorterFactory * @param Closure(static): Context $contextFactory */ + #[DataProvider('dataProviderGetNulls')] public function testGetNulls( ?Nulls $expected, ?array $config, diff --git a/packages/graphql/src/SortBy/Sorters/DatabaseSorterTest.php b/packages/graphql/src/SortBy/Sorters/DatabaseSorterTest.php index dcc6343ec..e1ca9258e 100644 --- a/packages/graphql/src/SortBy/Sorters/DatabaseSorterTest.php +++ b/packages/graphql/src/SortBy/Sorters/DatabaseSorterTest.php @@ -20,6 +20,7 @@ use Mockery; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function is_string; @@ -31,12 +32,11 @@ final class DatabaseSorterTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSortByColumn - * * @param array{query: string, bindings: array} $expected * @param Closure(static): (EloquentBuilder|QueryBuilder) $builderFactory * @param Closure(static): (EloquentBuilder|QueryBuilder)|string $columnFactory */ + #[DataProvider('dataProviderSortByColumn')] public function testSortByColumn( array $expected, Closure $builderFactory, diff --git a/packages/graphql/src/SortBy/Sorters/EloquentSorterTest.php b/packages/graphql/src/SortBy/Sorters/EloquentSorterTest.php index c05f3d7c6..6cd510190 100644 --- a/packages/graphql/src/SortBy/Sorters/EloquentSorterTest.php +++ b/packages/graphql/src/SortBy/Sorters/EloquentSorterTest.php @@ -32,6 +32,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\MergeDataProvider; use Mockery\MockInterface; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; use function is_array; @@ -44,12 +45,11 @@ final class EloquentSorterTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSort - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): EloquentBuilder $builder * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderSort')] public function testSort( array|Exception $expected, Closure $builder, diff --git a/packages/graphql/src/SortBy/Sorters/QuerySorterTest.php b/packages/graphql/src/SortBy/Sorters/QuerySorterTest.php index 3dd8ded6d..316e1e1cc 100644 --- a/packages/graphql/src/SortBy/Sorters/QuerySorterTest.php +++ b/packages/graphql/src/SortBy/Sorters/QuerySorterTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; use Mockery\MockInterface; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; use function is_array; @@ -27,12 +28,11 @@ final class QuerySorterTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSort - * * @param array{query: string, bindings: array}|Exception $expected * @param Closure(static): QueryBuilder $builder * @param Closure(object, Field): string|null $resolver */ + #[DataProvider('dataProviderSort')] public function testSort( array|Exception $expected, Closure $builder, diff --git a/packages/graphql/src/SortBy/Sorters/ScoutSorterTest.php b/packages/graphql/src/SortBy/Sorters/ScoutSorterTest.php index 907c717e3..c76a880da 100644 --- a/packages/graphql/src/SortBy/Sorters/ScoutSorterTest.php +++ b/packages/graphql/src/SortBy/Sorters/ScoutSorterTest.php @@ -16,6 +16,7 @@ use Mockery\MockInterface; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; use function is_array; @@ -29,12 +30,11 @@ final class ScoutSorterTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderSort - * * @param array|Exception $expected * @param Closure(object, Field): string|null $resolver * @param Closure():FieldResolver|null $fieldResolver */ + #[DataProvider('dataProviderSort')] public function testSort( array|Exception $expected, Field $field, diff --git a/packages/graphql/src/Stream/Directives/DirectiveTest.php b/packages/graphql/src/Stream/Directives/DirectiveTest.php index 7472b32d3..07d0538ce 100644 --- a/packages/graphql/src/Stream/Directives/DirectiveTest.php +++ b/packages/graphql/src/Stream/Directives/DirectiveTest.php @@ -72,6 +72,7 @@ use Nuwave\Lighthouse\Testing\MakesGraphQLRequests; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use ReflectionClass; use stdClass; @@ -106,13 +107,12 @@ protected function getPackageProviders(mixed $app): array { // // ========================================================================= /** - * @dataProvider dataProviderDirective - * * @param array|string $expected * @param Closure(static): void $factory * @param array|null $where * @param array|null $order */ + #[DataProvider('dataProviderDirective')] public function testDirective( array|string $expected, Closure $factory, @@ -189,13 +189,12 @@ public function testDirective( } /** - * @dataProvider dataProviderDirective - * * @param array|string $expected * @param Closure(static): void $factory * @param array|null $where * @param array|null $order */ + #[DataProvider('dataProviderDirective')] #[RequiresLaravelScout] public function testDirectiveScout( array|string $expected, @@ -443,11 +442,10 @@ public function testManipulateFieldDefinitionFieldIsUnion(): void { } /** - * @dataProvider dataProviderGetBuilderInfo - * * @param Closure(AstManipulator): (ObjectFieldSource|InterfaceFieldSource) $sourceFactory * @param Closure():mixed|array{class-string, string}|null $resolver */ + #[DataProvider('dataProviderGetBuilderInfo')] public function testGetBuilderInfo( Exception|BuilderInfo|null $expected, Closure $sourceFactory, @@ -695,11 +693,10 @@ public function testGetBuilderLighthouseEnhancer(): void { } /** - * @dataProvider dataProviderGetBuilderInfoScoutBuilder - * * @param Closure(AstManipulator): (ObjectFieldSource|InterfaceFieldSource) $sourceFactory * @param Closure():mixed|array{class-string, string}|null $resolver */ + #[DataProvider('dataProviderGetBuilderInfoScoutBuilder')] #[RequiresLaravelScout] public function testGetBuilderInfoScoutBuilder( Exception|BuilderInfo|null $expected, @@ -791,10 +788,9 @@ public function testGetResolver(): void { } /** - * @dataProvider dataProviderGetResolverExplicit - * * @param array{method: string, args: array}|null $expected */ + #[DataProvider('dataProviderGetResolverExplicit')] public function testGetResolverExplicit(array|null $expected, string $arguments): void { // Prepare $this->setConfig([ @@ -1061,10 +1057,9 @@ public function getResolverClass(string $class): array { } /** - * @dataProvider dataProviderGetArgKey - * * @param Closure(AstManipulator): (ObjectFieldSource|InterfaceFieldSource) $sourceFactory */ + #[DataProvider('dataProviderGetArgKey')] public function testGetArgKey( Exception|string $expected, string $schema, diff --git a/packages/graphql/src/Stream/Directives/OffsetTest.php b/packages/graphql/src/Stream/Directives/OffsetTest.php index 97a9462fd..885d1e13e 100644 --- a/packages/graphql/src/Stream/Directives/OffsetTest.php +++ b/packages/graphql/src/Stream/Directives/OffsetTest.php @@ -9,6 +9,7 @@ use Mockery; use Nuwave\Lighthouse\Execution\ResolveInfo; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -17,9 +18,7 @@ final class OffsetTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderGetFieldArgumentValue - */ + #[DataProvider('dataProviderGetFieldArgumentValue')] public function testGetFieldArgumentValue(Exception|StreamOffset $expected, ResolveInfo $info, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/graphql/src/Stream/Types/OffsetTest.php b/packages/graphql/src/Stream/Types/OffsetTest.php index 162d0cb24..0d4e3c7d6 100644 --- a/packages/graphql/src/Stream/Types/OffsetTest.php +++ b/packages/graphql/src/Stream/Types/OffsetTest.php @@ -14,6 +14,7 @@ use LastDragon_ru\LaraASP\GraphQL\Stream\Offset as StreamOffset; use LastDragon_ru\LaraASP\GraphQL\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function is_string; @@ -24,9 +25,7 @@ final class OffsetTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderSerialize - */ + #[DataProvider('dataProviderSerialize')] public function testSerialize(Exception|string|int $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); @@ -41,9 +40,7 @@ public function testSerialize(Exception|string|int $expected, mixed $value): voi self::assertEquals($expected, $actual); } - /** - * @dataProvider dataProviderParseValue - */ + #[DataProvider('dataProviderParseValue')] public function testParseValue(Exception|StreamOffset|int $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); @@ -58,9 +55,7 @@ public function testParseValue(Exception|StreamOffset|int $expected, mixed $valu self::assertEquals($expected, $actual); } - /** - * @dataProvider dataProviderParseLiteral - */ + #[DataProvider('dataProviderParseLiteral')] public function testParseLiteral(Exception|StreamOffset|int $expected, Node&ValueNode $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/graphql/src/Stream/Utils/PageTest.php b/packages/graphql/src/Stream/Utils/PageTest.php index 4553610cc..c118a317b 100644 --- a/packages/graphql/src/Stream/Utils/PageTest.php +++ b/packages/graphql/src/Stream/Utils/PageTest.php @@ -4,6 +4,7 @@ use LastDragon_ru\LaraASP\GraphQL\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -13,12 +14,11 @@ final class PageTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderConstruct - * * @param array $expected * @param int<0, max> $offset * @param int<1, max> $limit */ + #[DataProvider('dataProviderConstruct')] public function testConstruct(array $expected, int $offset, int $limit): void { $actual = new Page($limit, $offset); $actual = [ diff --git a/packages/graphql/src/Utils/AstManipulatorTest.php b/packages/graphql/src/Utils/AstManipulatorTest.php index 00c1d26a0..bcad81287 100644 --- a/packages/graphql/src/Utils/AstManipulatorTest.php +++ b/packages/graphql/src/Utils/AstManipulatorTest.php @@ -39,6 +39,7 @@ use Nuwave\Lighthouse\Support\Contracts\Directive; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use function array_keys; @@ -341,11 +342,10 @@ public function testGetDirectives(): void { } /** - * @dataProvider dataProviderAddArgument - * * @param Closure(AstManipulator): (ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType) $definitionFactory * @param Closure(AstManipulator, ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType): (FieldDefinitionNode|FieldDefinition) $fieldFactory */ + #[DataProvider('dataProviderAddArgument')] public function testAddArgument( Exception|string $expected, string $schema, @@ -430,11 +430,10 @@ static function (mixed $argument) use ($manipulator): bool { } /** - * @dataProvider dataProviderAddDirective - * * @param class-string $directive * @param array $arguments */ + #[DataProvider('dataProviderAddDirective')] public function testAddDirective( Exception|string $expected, FieldDefinitionNode|InputValueDefinitionNode|Argument $node, @@ -461,9 +460,7 @@ public function testAddDirective( } } - /** - * @dataProvider dataProviderIsDeprecated - */ + #[DataProvider('dataProviderIsDeprecated')] public function testIsDeprecated( bool $expected, Node|Argument|EnumValueDefinition|FieldDefinition|InputObjectField $node, @@ -472,12 +469,11 @@ public function testIsDeprecated( } /** - * @dataProvider dataProviderSetFieldType - * * @param Closure(AstManipulator): (ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType) $definitionFactory * @param Closure(AstManipulator, ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType): (FieldDefinitionNode|FieldDefinition) $fieldFactory * @param NamedTypeNode|ListTypeNode|NonNullTypeNode|(Type&InputType) $type */ + #[DataProvider('dataProviderSetFieldType')] public function testSetFieldType( Exception|string $expected, string $schema, @@ -502,13 +498,12 @@ public function testSetFieldType( } /** - * @dataProvider dataProviderSetArgumentType - * * @param Closure(AstManipulator): (ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType) $definitionFactory * @param Closure(AstManipulator, ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType): (FieldDefinitionNode|FieldDefinition) $fieldFactory * @param Closure(AstManipulator, ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|ObjectType|InterfaceType, FieldDefinitionNode|FieldDefinition): (InputValueDefinitionNode|Argument) $argumentFactory * @param NamedTypeNode|ListTypeNode|NonNullTypeNode|(Type&InputType) $type */ + #[DataProvider('dataProviderSetArgumentType')] public function testSetArgumentType( Exception|string $expected, string $schema, @@ -587,9 +582,7 @@ static function (mixed $field) use ($manipulator): bool { self::assertEquals('c', $typeField->name); } - /** - * @dataProvider dataProviderGetOriginType - */ + #[DataProvider('dataProviderGetOriginType')] public function testGetOriginType(string $expected, string $graphql): void { $ast = Mockery::mock(DocumentAST::class); $types = Container::getInstance()->make(TypeRegistry::class); diff --git a/packages/serializer/src/Casts/AsSerializableTest.php b/packages/serializer/src/Casts/AsSerializableTest.php index 9086e25b5..a0018cae1 100644 --- a/packages/serializer/src/Casts/AsSerializableTest.php +++ b/packages/serializer/src/Casts/AsSerializableTest.php @@ -9,6 +9,7 @@ use LastDragon_ru\LaraASP\Serializer\Testing\Package\TestCase; use Mockery; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -17,9 +18,7 @@ final class AsSerializableTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderGet - */ + #[DataProvider('dataProviderGet')] public function testGet(?object $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/serializer/src/ProviderTest.php b/packages/serializer/src/ProviderTest.php index d6ab7b293..4695f22e5 100644 --- a/packages/serializer/src/ProviderTest.php +++ b/packages/serializer/src/ProviderTest.php @@ -15,6 +15,7 @@ use LastDragon_ru\LaraASP\Serializer\Testing\Package\TestCase; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Stringable; use Symfony\Component\Serializer\Annotation\DiscriminatorMap; use Symfony\Component\Serializer\Exception\CircularReferenceException; @@ -42,9 +43,7 @@ public function testRegister(): void { ); } - /** - * @dataProvider dataProviderSerialization - */ + #[DataProvider('dataProviderSerialization')] public function testSerialization(Exception|string $expected, Serializable $serializable): void { try { $serializer = Container::getInstance()->make(SerializerContract::class); @@ -68,10 +67,9 @@ public function testSerialization(Exception|string $expected, Serializable $seri } /** - * @dataProvider dataProviderDeserialization - * * @param class-string $class */ + #[DataProvider('dataProviderDeserialization')] public function testDeserialization(Exception|Serializable $expected, string $class, string $serialized): void { try { $serializer = Container::getInstance()->make(SerializerContract::class); diff --git a/packages/spa/src/Angular/UrlTest.php b/packages/spa/src/Angular/UrlTest.php index 0085c3fa2..d7507fa0a 100644 --- a/packages/spa/src/Angular/UrlTest.php +++ b/packages/spa/src/Angular/UrlTest.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -15,10 +16,9 @@ final class UrlTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderConstruct - * * @param array $expected */ + #[DataProvider('dataProviderConstruct')] public function testConstruct(array $expected, string $template): void { $url = new Url($template); @@ -27,10 +27,9 @@ public function testConstruct(array $expected, string $template): void { } /** - * @dataProvider dataProviderBuild - * * @param array $parameters */ + #[DataProvider('dataProviderBuild')] public function testBuild(string|Exception $expected, string $template, array $parameters): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/spa/src/Http/Controllers/SpaControllerTest.php b/packages/spa/src/Http/Controllers/SpaControllerTest.php index ec86f0e21..2dcf00947 100644 --- a/packages/spa/src/Http/Controllers/SpaControllerTest.php +++ b/packages/spa/src/Http/Controllers/SpaControllerTest.php @@ -13,12 +13,13 @@ use LastDragon_ru\LaraASP\Testing\Constraints\Response\StatusCodes\Ok; use LastDragon_ru\LaraASP\Testing\Providers\ArrayDataProvider; use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; -use LastDragon_ru\LaraASP\Testing\Providers\DataProvider; +use LastDragon_ru\LaraASP\Testing\Providers\DataProvider as DataProviderContract; use LastDragon_ru\LaraASP\Testing\Providers\ExpectedFinal; use LastDragon_ru\LaraASP\Testing\Providers\UnknownValue; use LastDragon_ru\LaraASP\Testing\Responses\JsonResponse; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -43,11 +44,10 @@ protected function getEnvironmentSetUp($app): void { // // ========================================================================= /** - * @dataProvider dataProviderSettings - * * @param array $headers * @param array $settings */ + #[DataProvider('dataProviderSettings')] public function testSettings( Response $expected, bool $routes = true, @@ -98,7 +98,7 @@ public static function dataProviderSettings(): array { ))->getData(); } - protected static function getEnabledDataProvider(): DataProvider { + protected static function getEnabledDataProvider(): DataProviderContract { return new ArrayDataProvider([ 'disabled' => [ new ExpectedFinal(new NotFound()), @@ -111,7 +111,7 @@ protected static function getEnabledDataProvider(): DataProvider { ]); } - protected static function getPrefixDataProvider(): DataProvider { + protected static function getPrefixDataProvider(): DataProviderContract { return new ArrayDataProvider([ 'without prefix' => [ new UnknownValue(), @@ -124,7 +124,7 @@ protected static function getPrefixDataProvider(): DataProvider { ]); } - protected static function getAcceptDataProvider(): DataProvider { + protected static function getAcceptDataProvider(): DataProviderContract { return new ArrayDataProvider([ 'accept html' => [ new UnknownValue(), diff --git a/packages/spa/src/Http/Resources/ResourceCollectionTest.php b/packages/spa/src/Http/Resources/ResourceCollectionTest.php index d308dbe6a..3f60965e6 100644 --- a/packages/spa/src/Http/Resources/ResourceCollectionTest.php +++ b/packages/spa/src/Http/Resources/ResourceCollectionTest.php @@ -8,6 +8,7 @@ use InvalidArgumentException; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use function get_class; @@ -21,9 +22,7 @@ final class ResourceCollectionTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderConstruct - */ + #[DataProvider('dataProviderConstruct')] public function testConstruct(bool|Exception $expected, string $class): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/spa/src/Http/Resources/ResourceTest.php b/packages/spa/src/Http/Resources/ResourceTest.php index 3d0dda921..c4db8732d 100644 --- a/packages/spa/src/Http/Resources/ResourceTest.php +++ b/packages/spa/src/Http/Resources/ResourceTest.php @@ -18,6 +18,7 @@ use LogicException; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function get_class; use function json_decode; @@ -29,9 +30,7 @@ final class ResourceTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderConstruct - */ + #[DataProvider('dataProviderConstruct')] public function testConstruct(bool|Exception $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); @@ -45,10 +44,9 @@ public function testConstruct(bool|Exception $expected, mixed $value): void { } /** - * @dataProvider dataProviderCollection - * * @param class-string $expected */ + #[DataProvider('dataProviderCollection')] public function testCollection(string $expected, mixed $value): void { $class = get_class( new class(null) extends Resource { @@ -61,10 +59,9 @@ public function testCollection(string $expected, mixed $value): void { } /** - * @dataProvider dataProviderMapResourceData - * * @param array|Exception $expected */ + #[DataProvider('dataProviderMapResourceData')] public function testMapResourceData(array|Exception $expected, mixed $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/spa/src/Testing/Http/Resources/PaginatedCollectionTest.php b/packages/spa/src/Testing/Http/Resources/PaginatedCollectionTest.php index 6b950b040..94d3a2667 100644 --- a/packages/spa/src/Testing/Http/Resources/PaginatedCollectionTest.php +++ b/packages/spa/src/Testing/Http/Resources/PaginatedCollectionTest.php @@ -5,6 +5,7 @@ use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use LastDragon_ru\LaraASP\Testing\Constraints\Json\JsonMatchesSchema; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\ExpectationFailedException; /** @@ -17,10 +18,9 @@ final class PaginatedCollectionTest extends TestCase { /** * @coversNothing * - * @dataProvider dataProviderSchema - * * @param array $json */ + #[DataProvider('dataProviderSchema')] public function testSchema(bool $expected, array $json): void { $schema = new PaginatedCollection(self::class); $constraint = new JsonMatchesSchema($schema); diff --git a/packages/spa/src/Testing/Http/Resources/ResourceCollectionTest.php b/packages/spa/src/Testing/Http/Resources/ResourceCollectionTest.php index 7e8027bfe..291edbebc 100644 --- a/packages/spa/src/Testing/Http/Resources/ResourceCollectionTest.php +++ b/packages/spa/src/Testing/Http/Resources/ResourceCollectionTest.php @@ -5,6 +5,7 @@ use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use LastDragon_ru\LaraASP\Testing\Constraints\Json\JsonMatchesSchema; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\ExpectationFailedException; /** @@ -17,10 +18,9 @@ final class ResourceCollectionTest extends TestCase { /** * @coversNothing * - * @dataProvider dataProviderSchema - * * @param array $json */ + #[DataProvider('dataProviderSchema')] public function testSchema(bool $expected, array $json): void { $schema = new ResourceCollection(self::class); $constraint = new JsonMatchesSchema($schema); diff --git a/packages/spa/src/Validation/Rules/BoolRuleTest.php b/packages/spa/src/Validation/Rules/BoolRuleTest.php index 756e3b417..23cb4f368 100644 --- a/packages/spa/src/Validation/Rules/BoolRuleTest.php +++ b/packages/spa/src/Validation/Rules/BoolRuleTest.php @@ -6,6 +6,7 @@ use Illuminate\Contracts\Translation\Translator; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -14,9 +15,7 @@ final class BoolRuleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPasses - */ + #[DataProvider('dataProviderPasses')] public function testPasses(bool $expected, mixed $value): void { $translator = Container::getInstance()->make(Translator::class); $rule = new BoolRule($translator); diff --git a/packages/spa/src/Validation/Rules/DateRuleTest.php b/packages/spa/src/Validation/Rules/DateRuleTest.php index 25d12ebb0..c52363907 100644 --- a/packages/spa/src/Validation/Rules/DateRuleTest.php +++ b/packages/spa/src/Validation/Rules/DateRuleTest.php @@ -8,6 +8,7 @@ use InvalidArgumentException; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -16,9 +17,7 @@ final class DateRuleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPasses - */ + #[DataProvider('dataProviderPasses')] public function testPasses(bool $expected, string $value): void { $translator = Container::getInstance()->make(Translator::class); $rule = new DateRule($translator); @@ -33,9 +32,7 @@ public function testMessage(): void { self::assertEquals('The :attribute is not a valid date.', $rule->message()); } - /** - * @dataProvider dataProviderGetValue - */ + #[DataProvider('dataProviderGetValue')] public function testGetValue(Exception|string|null $expected, string $value): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/spa/src/Validation/Rules/DateTimeRuleTest.php b/packages/spa/src/Validation/Rules/DateTimeRuleTest.php index a170eff0f..299e324f1 100644 --- a/packages/spa/src/Validation/Rules/DateTimeRuleTest.php +++ b/packages/spa/src/Validation/Rules/DateTimeRuleTest.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Throwable; use function is_array; @@ -18,9 +19,7 @@ final class DateTimeRuleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPasses - */ + #[DataProvider('dataProviderPasses')] public function testPasses(bool $expected, string $value): void { $translator = Container::getInstance()->make(Translator::class); $rule = new DateTimeRule($translator); @@ -36,10 +35,9 @@ public function testMessage(): void { } /** - * @dataProvider dataProviderGetValue - * * @param array{class: class-string, message: string}|string $expected */ + #[DataProvider('dataProviderGetValue')] public function testGetValue(string|array $expected, ?string $tz, string $value): void { if (is_array($expected)) { self::expectException($expected['class']); diff --git a/packages/spa/src/Validation/Rules/IntRuleTest.php b/packages/spa/src/Validation/Rules/IntRuleTest.php index ef64ca09f..d80f2d630 100644 --- a/packages/spa/src/Validation/Rules/IntRuleTest.php +++ b/packages/spa/src/Validation/Rules/IntRuleTest.php @@ -6,6 +6,7 @@ use Illuminate\Contracts\Translation\Translator; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use const INF; use const NAN; @@ -17,9 +18,7 @@ final class IntRuleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPasses - */ + #[DataProvider('dataProviderPasses')] public function testPasses(bool $expected, mixed $value): void { $translator = Container::getInstance()->make(Translator::class); $rule = new IntRule($translator); diff --git a/packages/spa/src/Validation/Rules/NumberRuleTest.php b/packages/spa/src/Validation/Rules/NumberRuleTest.php index 8be7e5472..38e4c7cd0 100644 --- a/packages/spa/src/Validation/Rules/NumberRuleTest.php +++ b/packages/spa/src/Validation/Rules/NumberRuleTest.php @@ -6,6 +6,7 @@ use Illuminate\Contracts\Translation\Translator; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use const INF; use const NAN; @@ -17,9 +18,7 @@ final class NumberRuleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPasses - */ + #[DataProvider('dataProviderPasses')] public function testPasses(bool $expected, mixed $value): void { $translator = Container::getInstance()->make(Translator::class); $rule = new NumberRule($translator); diff --git a/packages/spa/src/Validation/Rules/StringRuleTest.php b/packages/spa/src/Validation/Rules/StringRuleTest.php index 429831214..3f2f0a664 100644 --- a/packages/spa/src/Validation/Rules/StringRuleTest.php +++ b/packages/spa/src/Validation/Rules/StringRuleTest.php @@ -6,6 +6,7 @@ use Illuminate\Contracts\Translation\Translator; use LastDragon_ru\LaraASP\Spa\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -14,9 +15,7 @@ final class StringRuleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderPasses - */ + #[DataProvider('dataProviderPasses')] public function testPasses(bool $expected, mixed $value): void { $translator = Container::getInstance()->make(Translator::class); $rule = new StringRule($translator); diff --git a/packages/testing/README.md b/packages/testing/README.md index 5bb1ba977..30783573e 100644 --- a/packages/testing/README.md +++ b/packages/testing/README.md @@ -679,10 +679,10 @@ use LastDragon_ru\LaraASP\Testing\Constraints\Response\StatusCodes\Ok; use LastDragon_ru\LaraASP\Testing\Constraints\Response\StatusCodes\Unauthorized; use LastDragon_ru\LaraASP\Testing\Providers\ArrayDataProvider; use LastDragon_ru\LaraASP\Testing\Providers\CompositeDataProvider; -use LastDragon_ru\LaraASP\Testing\Providers\DataProvider; +use LastDragon_ru\LaraASP\Testing\Providers\DataProvider as DataProviderContract; use LastDragon_ru\LaraASP\Testing\Providers\ExpectedFinal; use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\ValidationErrorResponse; -use Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider;use Tests\TestCase; class ExampleTest extends TestCase { // @@ -706,9 +706,7 @@ class ExampleTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderGet - */ + #[DataProvider('dataProviderGet')] public function testGet(Response $expected, Closure $actingAs = null, Closure $user = null): void { $user = $user ? $user()->getKey() : 0; @@ -719,9 +717,7 @@ class ExampleTest extends TestCase { $this->getJson("/users/{$user}")->assertThat($expected); } - /** - * @dataProvider dataProviderUpdate - */ + #[DataProvider('dataProviderUpdate')] public function testUpdate(Response $expected, Closure $actingAs = null, Closure $user = null, array $data = []) { $user = $user ? $user()->getKey() : 0; @@ -773,7 +769,7 @@ class ExampleTest extends TestCase { // // ========================================================================= - protected static function getUserDataProvider(): DataProvider { + protected static function getUserDataProvider(): DataProviderContract { return new ArrayDataProvider([ 'guest' => [ new ExpectedFinal(new Unauthorized()), @@ -788,7 +784,7 @@ class ExampleTest extends TestCase { ]); } - protected static function getModelDataProvider(): DataProvider { + protected static function getModelDataProvider(): DataProviderContract { return new ArrayDataProvider([ 'user not exists' => [ new ExpectedFinal(new NotFound()), diff --git a/packages/testing/src/Comparators/DatabaseQueryComparatorTest.php b/packages/testing/src/Comparators/DatabaseQueryComparatorTest.php index 985d43b2a..42dd98d12 100644 --- a/packages/testing/src/Comparators/DatabaseQueryComparatorTest.php +++ b/packages/testing/src/Comparators/DatabaseQueryComparatorTest.php @@ -6,6 +6,7 @@ use LastDragon_ru\LaraASP\Testing\Package\TestCase; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory; use stdClass; @@ -17,16 +18,12 @@ final class DatabaseQueryComparatorTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderAccepts - */ + #[DataProvider('dataProviderAccepts')] public function testAccepts(bool $equals, mixed $expected, mixed $actual): void { self::assertEquals($equals, (new DatabaseQueryComparator())->accepts($expected, $actual)); } - /** - * @dataProvider dataProviderAssertEquals - */ + #[DataProvider('dataProviderAssertEquals')] public function testAssertEquals(bool|string $equals, mixed $expected, mixed $actual): void { if ($equals !== true) { self::expectException(ComparisonFailure::class); diff --git a/packages/testing/src/Comparators/EloquentModelComparatorTest.php b/packages/testing/src/Comparators/EloquentModelComparatorTest.php index 726890940..7d5c78be1 100644 --- a/packages/testing/src/Comparators/EloquentModelComparatorTest.php +++ b/packages/testing/src/Comparators/EloquentModelComparatorTest.php @@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model; use LastDragon_ru\LaraASP\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory; use stdClass; @@ -16,16 +17,12 @@ final class EloquentModelComparatorTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderAccepts - */ + #[DataProvider('dataProviderAccepts')] public function testAccepts(bool $equals, mixed $expected, mixed $actual): void { self::assertEquals($equals, (new EloquentModelComparator())->accepts($expected, $actual)); } - /** - * @dataProvider dataProviderAssertEquals - */ + #[DataProvider('dataProviderAssertEquals')] public function testAssertEquals(bool|string $equals, mixed $expected, mixed $actual): void { if ($equals !== true) { self::expectException(ComparisonFailure::class); diff --git a/packages/testing/src/Comparators/ScalarStrictComparatorTest.php b/packages/testing/src/Comparators/ScalarStrictComparatorTest.php index ddb903a39..d2f252486 100644 --- a/packages/testing/src/Comparators/ScalarStrictComparatorTest.php +++ b/packages/testing/src/Comparators/ScalarStrictComparatorTest.php @@ -4,6 +4,7 @@ use LastDragon_ru\LaraASP\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use SebastianBergmann\Comparator\ComparisonFailure; /** @@ -13,9 +14,7 @@ final class ScalarStrictComparatorTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderAssertEquals - */ + #[DataProvider('dataProviderAssertEquals')] public function testAssertEquals(bool $equals, mixed $expected, mixed $actual): void { if (!$equals) { self::expectException(ComparisonFailure::class); diff --git a/packages/testing/src/Constraints/Json/ProtocolTest.php b/packages/testing/src/Constraints/Json/ProtocolTest.php index 4c403210c..fc1eeefce 100644 --- a/packages/testing/src/Constraints/Json/ProtocolTest.php +++ b/packages/testing/src/Constraints/Json/ProtocolTest.php @@ -6,6 +6,7 @@ use LastDragon_ru\LaraASP\Testing\Package\TestCase; use OutOfBoundsException; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use SplFileInfo; use function array_map; @@ -27,10 +28,9 @@ final class ProtocolTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderInvoke - * * @param array $parameters */ + #[DataProvider('dataProviderInvoke')] public function testInvoke(Exception|string $expected, string $content, array $parameters): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/testing/src/Constraints/Json/TemplateTest.php b/packages/testing/src/Constraints/Json/TemplateTest.php index ec30788e0..39b04f6fc 100644 --- a/packages/testing/src/Constraints/Json/TemplateTest.php +++ b/packages/testing/src/Constraints/Json/TemplateTest.php @@ -6,6 +6,7 @@ use LastDragon_ru\LaraASP\Testing\Package\TestCase; use OutOfBoundsException; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function json_decode; @@ -17,10 +18,9 @@ final class TemplateTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderBuild - * * @param array $parameters */ + #[DataProvider('dataProviderBuild')] public function testBuild(Exception|string $expected, string $content, array $parameters): void { if ($expected instanceof Exception) { self::expectExceptionObject($expected); diff --git a/packages/testing/src/Constraints/Xml/XmlMatchesSchemaTest.php b/packages/testing/src/Constraints/Xml/XmlMatchesSchemaTest.php index db9a216ba..383027f24 100644 --- a/packages/testing/src/Constraints/Xml/XmlMatchesSchemaTest.php +++ b/packages/testing/src/Constraints/Xml/XmlMatchesSchemaTest.php @@ -6,6 +6,7 @@ use LastDragon_ru\LaraASP\Testing\Package\TestCase; use Override; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use SplFileInfo; use function is_string; @@ -17,9 +18,7 @@ final class XmlMatchesSchemaTest extends TestCase { // // ========================================================================= - /** - * @dataProvider dataProviderEvaluate - */ + #[DataProvider('dataProviderEvaluate')] public function testEvaluate(bool|string $expected, SplFileInfo $schema, DOMDocument|SplFileInfo $xml): void { $constraint = new class($schema) extends XmlMatchesSchema { #[Override] diff --git a/packages/testing/src/Responses/Laravel/Json/ValidationErrorResponseTest.php b/packages/testing/src/Responses/Laravel/Json/ValidationErrorResponseTest.php index 904847baa..84493c936 100644 --- a/packages/testing/src/Responses/Laravel/Json/ValidationErrorResponseTest.php +++ b/packages/testing/src/Responses/Laravel/Json/ValidationErrorResponseTest.php @@ -9,6 +9,7 @@ use LastDragon_ru\LaraASP\Testing\Constraints\Response\Factory as ResponseFactory; use LastDragon_ru\LaraASP\Testing\Package\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -18,11 +19,10 @@ final class ValidationErrorResponseTest extends TestCase { // // ========================================================================= /** - * @dataProvider dataProviderEvaluate - * * @param array $rules * @param array|null $errors */ + #[DataProvider('dataProviderEvaluate')] public function testEvaluate(bool $expected, array $rules, ?array $errors): void { Container::getInstance()->make(Registrar::class) ->get(__FUNCTION__, static function (Request $request) use ($rules) {