From 2283f8bf7e01cac1afcb4d07f662de9366a9abc0 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 2 Mar 2024 13:59:33 +0000 Subject: [PATCH 1/6] Bump dependencies for Laravel 11 --- composer.json | 136 +++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/composer.json b/composer.json index 3c962c5..3bea6c2 100644 --- a/composer.json +++ b/composer.json @@ -1,70 +1,70 @@ { - "name": "worksome/graphlint", - "description": "A static analysis tool for GraphQl", - "type": "project", - "require": { - "php": "^8.2", - "webonyx/graphql-php": "^15.0.1", - "symfony/console": "^6.1", - "illuminate/support": "^10.0", - "symfony/dependency-injection": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/config": "^6.0", - "symplify/autowire-array-parameter": "^11.0", - "symplify/package-builder": "^11.0", - "thecodingmachine/safe": "^2.4", - "jawira/case-converter": "^3.5" - }, - "require-dev": { - "pestphp/pest": "^2.0", - "symfony/var-dumper": "^6.0", - "symplify/easy-testing": "^11.0", - "worksome/coding-style": "^2.5" - }, - "license": "MIT", - "autoload": { - "psr-4": { - "Worksome\\Graphlint\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Worksome\\Graphlint\\Tests\\": "tests/" - } - }, - "bin": [ - "bin/graphlint" - ], - "authors": [ - { - "name": "Oliver Nybroe", - "email": "oliver@worksome.com" - } - ], - "config": { - "allow-plugins": { - "pestphp/pest-plugin": true, - "dealerdirect/phpcodesniffer-composer-installer": true, - "worksome/coding-style": true - } - }, - "scripts": { - "ecs": "vendor/bin/ecs", - "ecs:fix": "vendor/bin/ecs --fix", - "phpstan": "vendor/bin/phpstan analyse", - "rector": "vendor/bin/rector process --dry-run --ansi", - "rector:fix": "vendor/bin/rector process --ansi", - "pest": "vendor/bin/pest --parallel", - "test": [ - "@ecs", - "@phpstan", - "@rector", - "@pest" - ] - }, - "suggest": { - "ext-dom": "Required for Checkstyle output format." - }, - "minimum-stability": "dev", - "prefer-stable": true + "name": "worksome/graphlint", + "description": "A static analysis tool for GraphQl", + "type": "project", + "require": { + "php": "^8.2", + "webonyx/graphql-php": "^15.0.1", + "symfony/console": "^6.1|^7.0", + "illuminate/support": "^10.0|^11.0", + "symfony/dependency-injection": "^6.0|^7.0", + "symfony/http-kernel": "^6.0|^7.0", + "symfony/config": "^6.0|^7.0", + "symplify/autowire-array-parameter": "^11.0", + "symplify/package-builder": "^11.0", + "thecodingmachine/safe": "^2.4", + "jawira/case-converter": "^3.5" + }, + "require-dev": { + "pestphp/pest": "^2.0", + "symfony/var-dumper": "^6.0|^7.0", + "symplify/easy-testing": "^11.0", + "worksome/coding-style": "^2.5" + }, + "license": "MIT", + "autoload": { + "psr-4": { + "Worksome\\Graphlint\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Worksome\\Graphlint\\Tests\\": "tests/" + } + }, + "bin": [ + "bin/graphlint" + ], + "authors": [ + { + "name": "Oliver Nybroe", + "email": "oliver@worksome.com" + } + ], + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "worksome/coding-style": true + } + }, + "scripts": { + "ecs": "vendor/bin/ecs", + "ecs:fix": "vendor/bin/ecs --fix", + "phpstan": "vendor/bin/phpstan analyse", + "rector": "vendor/bin/rector process --dry-run --ansi", + "rector:fix": "vendor/bin/rector process --ansi", + "pest": "vendor/bin/pest --parallel", + "test": [ + "@ecs", + "@phpstan", + "@rector", + "@pest" + ] + }, + "suggest": { + "ext-dom": "Required for Checkstyle output format." + }, + "minimum-stability": "dev", + "prefer-stable": true } From 2979459d4b6e0bef3eb4b57f7094ba72d2e832ba Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 2 Mar 2024 13:59:33 +0000 Subject: [PATCH 2/6] Update GitHub Actions for Laravel 11 --- .github/workflows/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 391a440..1368a2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,14 +6,16 @@ on: jobs: setup: timeout-minutes: 15 + runs-on: ${{ matrix.os }} + strategy: fail-fast: true matrix: - os: [ ubuntu-latest ] - php: [ 8.2 ] - laravel: [ 10.* ] - stability: [ prefer-lowest, prefer-stable ] + os: [ubuntu-latest] + php: [8.2] + laravel: ['10.*', '11.*'] + stability: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From b55950a8de50fe5ccfb2187871192d89ad549cd7 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Mon, 22 Apr 2024 16:15:44 +0100 Subject: [PATCH 3/6] feat: apply additional tweaks --- composer.json | 24 ++++++++++++------------ phpunit.xml | 4 ++-- rector.php | 1 - src/Inspections/Inspection.php | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 3bea6c2..90a8efc 100644 --- a/composer.json +++ b/composer.json @@ -4,22 +4,22 @@ "type": "project", "require": { "php": "^8.2", - "webonyx/graphql-php": "^15.0.1", - "symfony/console": "^6.1|^7.0", + "webonyx/graphql-php": "^15.11", + "symfony/console": "^6.4|^7.0", "illuminate/support": "^10.0|^11.0", - "symfony/dependency-injection": "^6.0|^7.0", - "symfony/http-kernel": "^6.0|^7.0", - "symfony/config": "^6.0|^7.0", - "symplify/autowire-array-parameter": "^11.0", - "symplify/package-builder": "^11.0", - "thecodingmachine/safe": "^2.4", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symplify/autowire-array-parameter": "^11.1", + "symplify/package-builder": "^11.3", + "thecodingmachine/safe": "^2.5", "jawira/case-converter": "^3.5" }, "require-dev": { - "pestphp/pest": "^2.0", - "symfony/var-dumper": "^6.0|^7.0", - "symplify/easy-testing": "^11.0", - "worksome/coding-style": "^2.5" + "pestphp/pest": "^2.34", + "symfony/var-dumper": "^6.4|^7.0", + "symplify/easy-testing": "^11.1", + "worksome/coding-style": "^2.10.2" }, "license": "MIT", "autoload": { diff --git a/phpunit.xml b/phpunit.xml index f368d59..6d03a8b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -10,9 +10,9 @@ ./tests - + ./src - + diff --git a/rector.php b/rector.php index c6480c8..c83f8c0 100644 --- a/rector.php +++ b/rector.php @@ -23,7 +23,6 @@ SetList::PHP_80, SetList::PHP_74, SetList::EARLY_RETURN, - SetList::PSR_4, ]); // Register extra a single rules diff --git a/src/Inspections/Inspection.php b/src/Inspections/Inspection.php index 20d1a4f..f79c986 100644 --- a/src/Inspections/Inspection.php +++ b/src/Inspections/Inspection.php @@ -99,7 +99,7 @@ public function visitEnumValueDefinition( ): void { } - public function __toString() + public function __toString(): string { return class_basename($this); } From 9eb71e3cb9ec1e88a6f1b37dfc0fde9b1e882844 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Mon, 22 Apr 2024 16:56:42 +0100 Subject: [PATCH 4/6] test: update to remove deprecated Easy Testing --- composer.json | 4 +- .../snake_case_field.graphql.inc | 4 -- .../input_without_suffix.graphql.inc | 4 -- ...irective_type_without_id_field.graphql.inc | 5 --- ...field_argument_named_something.graphql.inc | 5 --- .../nullable_id_field.graphql.inc | 5 --- .../nullable_inside_list_field.graphql.inc | 5 --- .../nullable_field_list.graphql.inc | 5 --- .../snake_case_type.graphql.inc | 4 -- ...amel_case_multi_word_enum_case.graphql.inc | 4 -- .../lower_snake_case_enum_case.graphql.inc | 4 -- .../pascal_case_enum_case.graphql.inc | 4 -- ...scal_case_multi_word_enum_case.graphql.inc | 4 -- ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 4 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 4 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 1 + ...nent_Finder_SplFileInfo_Object_______.snap | 1 + ...nent_Finder_SplFileInfo_Object_______.snap | 4 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 1 + ...nent_Finder_SplFileInfo_Object_______.snap | 1 + ...nent_Finder_SplFileInfo_Object_______.snap | 4 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 1 + ...nent_Finder_SplFileInfo_Object_______.snap | 4 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 4 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ ...nent_Finder_SplFileInfo_Object_______.snap | 3 ++ .../CamelCaseFieldInspectionTest.php | 9 ++-- .../DescriptionRequiredInspectionTest.php | 7 ++- .../DisallowEnumInspectionTest.php | 7 ++- ...IgnoreNextLineSuppressorInspectionTest.php | 7 ++- ...nputObjectTypeDefinitionInspectionTest.php | 7 ++- ...DirectiveRequiresIdFieldInspectionTest.php | 7 ++- ...nFieldArgumentNamedInputInspectionTest.php | 7 ++- .../NonNullableIdInspectionTest.php | 7 ++- .../NonNullableInsideListInspectionTest.php | 7 ++- .../NonNullableListInspectionTest.php | 6 +-- ...CaseObjectTypeDefinitionInspectionTest.php | 7 ++- ...keCaseEnumCaseDefinitionInspectionTest.php | 6 +-- tests/Pest.php | 43 ++++++------------- 48 files changed, 114 insertions(+), 132 deletions(-) create mode 100644 tests/.pest/snapshots/Feature/Inspections/CamelCaseFieldInspectionTest/it_can_rename_field_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DisallowEnumInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo____Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest/it_can_rename_argument_field_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/NonNullableIdInspectionTest/it_can_make_id_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap diff --git a/composer.json b/composer.json index 90a8efc..4f5d2b5 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,8 @@ "require-dev": { "pestphp/pest": "^2.34", "symfony/var-dumper": "^6.4|^7.0", - "symplify/easy-testing": "^11.1", - "worksome/coding-style": "^2.10.2" + "worksome/coding-style": "^2.10.2", + "symfony/finder": "^6.4|^7.0" }, "license": "MIT", "autoload": { diff --git a/test-resources/Inspections/CamelCaseFieldInspectionTest/snake_case_field.graphql.inc b/test-resources/Inspections/CamelCaseFieldInspectionTest/snake_case_field.graphql.inc index c3f937e..742268f 100644 --- a/test-resources/Inspections/CamelCaseFieldInspectionTest/snake_case_field.graphql.inc +++ b/test-resources/Inspections/CamelCaseFieldInspectionTest/snake_case_field.graphql.inc @@ -1,7 +1,3 @@ type User { full_name: String! } ------ -type User { - fullName: String! -} diff --git a/test-resources/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/input_without_suffix.graphql.inc b/test-resources/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/input_without_suffix.graphql.inc index c999220..bf82eb8 100644 --- a/test-resources/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/input_without_suffix.graphql.inc +++ b/test-resources/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/input_without_suffix.graphql.inc @@ -1,7 +1,3 @@ input User { fullName: String! } ------ -input UserInput { - fullName: String! -} diff --git a/test-resources/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/model_directive_type_without_id_field.graphql.inc b/test-resources/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/model_directive_type_without_id_field.graphql.inc index f8d763a..3e1fec9 100644 --- a/test-resources/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/model_directive_type_without_id_field.graphql.inc +++ b/test-resources/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/model_directive_type_without_id_field.graphql.inc @@ -1,8 +1,3 @@ type User @model { name: String! } ------ -type User @model { - id: ID! - name: String! -} diff --git a/test-resources/Inspections/MutationFieldArgumentNamedInputInspectionTest/mutation_field_argument_named_something.graphql.inc b/test-resources/Inspections/MutationFieldArgumentNamedInputInspectionTest/mutation_field_argument_named_something.graphql.inc index 957da25..b5280d0 100644 --- a/test-resources/Inspections/MutationFieldArgumentNamedInputInspectionTest/mutation_field_argument_named_something.graphql.inc +++ b/test-resources/Inspections/MutationFieldArgumentNamedInputInspectionTest/mutation_field_argument_named_something.graphql.inc @@ -1,8 +1,3 @@ type Mutation { version(environment: String!): String! } - ------ -type Mutation { - version(input: String!): String! -} diff --git a/test-resources/Inspections/NonNullableIdInspectionTest/nullable_id_field.graphql.inc b/test-resources/Inspections/NonNullableIdInspectionTest/nullable_id_field.graphql.inc index 9d269dc..9b0fcd6 100644 --- a/test-resources/Inspections/NonNullableIdInspectionTest/nullable_id_field.graphql.inc +++ b/test-resources/Inspections/NonNullableIdInspectionTest/nullable_id_field.graphql.inc @@ -1,8 +1,3 @@ type Person { id: ID } - ------ -type Person { - id: ID! -} diff --git a/test-resources/Inspections/NonNullableInsideListInspectionTest/nullable_inside_list_field.graphql.inc b/test-resources/Inspections/NonNullableInsideListInspectionTest/nullable_inside_list_field.graphql.inc index a1f9997..6d76c81 100644 --- a/test-resources/Inspections/NonNullableInsideListInspectionTest/nullable_inside_list_field.graphql.inc +++ b/test-resources/Inspections/NonNullableInsideListInspectionTest/nullable_inside_list_field.graphql.inc @@ -1,8 +1,3 @@ type Person { friends: [Person]! } - ------ -type Person { - friends: [Person!]! -} diff --git a/test-resources/Inspections/NonNullableListInspectionTest/nullable_field_list.graphql.inc b/test-resources/Inspections/NonNullableListInspectionTest/nullable_field_list.graphql.inc index 06e3c46..a559a5f 100644 --- a/test-resources/Inspections/NonNullableListInspectionTest/nullable_field_list.graphql.inc +++ b/test-resources/Inspections/NonNullableListInspectionTest/nullable_field_list.graphql.inc @@ -1,8 +1,3 @@ type Person { friends: [Person] } - ------ -type Person { - friends: [Person]! -} diff --git a/test-resources/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/snake_case_type.graphql.inc b/test-resources/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/snake_case_type.graphql.inc index d266cd3..0c5c49d 100644 --- a/test-resources/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/snake_case_type.graphql.inc +++ b/test-resources/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/snake_case_type.graphql.inc @@ -1,7 +1,3 @@ type user_information { fullName: String! } ------ -type UserInformation { - fullName: String! -} diff --git a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/camel_case_multi_word_enum_case.graphql.inc b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/camel_case_multi_word_enum_case.graphql.inc index 59eb420..e72ea1b 100644 --- a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/camel_case_multi_word_enum_case.graphql.inc +++ b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/camel_case_multi_word_enum_case.graphql.inc @@ -1,7 +1,3 @@ enum Status { inProgress } ------ -enum Status { - IN_PROGRESS -} diff --git a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/lower_snake_case_enum_case.graphql.inc b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/lower_snake_case_enum_case.graphql.inc index f08b412..47d0462 100644 --- a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/lower_snake_case_enum_case.graphql.inc +++ b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/lower_snake_case_enum_case.graphql.inc @@ -1,7 +1,3 @@ enum Status { in_progress } ------ -enum Status { - IN_PROGRESS -} diff --git a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_enum_case.graphql.inc b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_enum_case.graphql.inc index 98f8d39..ba48e91 100644 --- a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_enum_case.graphql.inc +++ b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_enum_case.graphql.inc @@ -1,7 +1,3 @@ enum Status { Active } ------ -enum Status { - ACTIVE -} diff --git a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_multi_word_enum_case.graphql.inc b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_multi_word_enum_case.graphql.inc index dae7129..960be8b 100644 --- a/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_multi_word_enum_case.graphql.inc +++ b/test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/pascal_case_multi_word_enum_case.graphql.inc @@ -1,7 +1,3 @@ enum Status { InProgress } ------ -enum Status { - IN_PROGRESS -} diff --git a/tests/.pest/snapshots/Feature/Inspections/CamelCaseFieldInspectionTest/it_can_rename_field_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/CamelCaseFieldInspectionTest/it_can_rename_field_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..703ae22 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/CamelCaseFieldInspectionTest/it_can_rename_field_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +type User { + fullName: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..386017c --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +enum Some { + "A test" + TEST +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..2c63584 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +"Input for a user" +input UserInput { + name: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..8f601b1 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +scalar something diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..9300c54 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +union Pro = User | Company diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..0d28cee --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +"Allowed cakes" +enum Cake { + CHOCOLATE +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..541235e --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +interface Admin diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..08ba028 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +type User diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..ace1cd6 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +"Some user" +type User { + name: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..ed07555 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +input Something diff --git a/tests/.pest/snapshots/Feature/Inspections/DisallowEnumInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DisallowEnumInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..f2a6b0f --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DisallowEnumInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +enum MyEnum { + GOOD + BAD +} diff --git a/tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..3a56d64 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +input UserInput { + fullName: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo____Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo____Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..0d4298d --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest/it_can_disallow_enums_with_data_set___Symfony_Component_Finder_SplFileInfo____Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +type User @model { + id: ID! + name: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest/it_can_rename_argument_field_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest/it_can_rename_argument_field_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..76f270d --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest/it_can_rename_argument_field_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +type Mutation { + version(input: String!): String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/NonNullableIdInspectionTest/it_can_make_id_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/NonNullableIdInspectionTest/it_can_make_id_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..65db32a --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/NonNullableIdInspectionTest/it_can_make_id_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +type Person { + id: ID! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..125a028 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +type Person { + friends: [Person!]! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..6d76c81 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +type Person { + friends: [Person]! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..c3c4e14 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +type UserInformation { + fullName: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..c330b9b --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +enum Status { + IN_PROGRESS +} diff --git a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..c330b9b --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +enum Status { + IN_PROGRESS +} diff --git a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..a72a646 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +enum Status { + ACTIVE +} diff --git a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..c330b9b --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,3 @@ +enum Status { + IN_PROGRESS +} diff --git a/tests/Feature/Inspections/CamelCaseFieldInspectionTest.php b/tests/Feature/Inspections/CamelCaseFieldInspectionTest.php index a9c7906..70028eb 100644 --- a/tests/Feature/Inspections/CamelCaseFieldInspectionTest.php +++ b/tests/Feature/Inspections/CamelCaseFieldInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\CamelCaseFieldDefinitionInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can rename field', function (SmartFileInfo $smartFileInfo) { +it('can rename field', function (SplFileInfo $fileInfo) { $inspection = $this->app->get(CamelCaseFieldDefinitionInspection::class); - expect($smartFileInfo) + expect($fileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/CamelCaseFieldInspectionTest' )); diff --git a/tests/Feature/Inspections/DescriptionRequiredInspectionTest.php b/tests/Feature/Inspections/DescriptionRequiredInspectionTest.php index 2673643..11a3ec9 100644 --- a/tests/Feature/Inspections/DescriptionRequiredInspectionTest.php +++ b/tests/Feature/Inspections/DescriptionRequiredInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\DescriptionRequiredInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can require description', function (SmartFileInfo $smartFileInfo) { +it('can require description', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(DescriptionRequiredInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/DescriptionRequiredInspectionTest' )); diff --git a/tests/Feature/Inspections/DisallowEnumInspectionTest.php b/tests/Feature/Inspections/DisallowEnumInspectionTest.php index 1538d5e..884e32b 100644 --- a/tests/Feature/Inspections/DisallowEnumInspectionTest.php +++ b/tests/Feature/Inspections/DisallowEnumInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\DisallowEnumInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can disallow enums', function (SmartFileInfo $smartFileInfo) { +it('can disallow enums', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(DisallowEnumInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/DisallowEnumInspectionTest' )); diff --git a/tests/Feature/Inspections/IgnoreNextLineSuppressorInspectionTest.php b/tests/Feature/Inspections/IgnoreNextLineSuppressorInspectionTest.php index 5b44448..50bbb2b 100644 --- a/tests/Feature/Inspections/IgnoreNextLineSuppressorInspectionTest.php +++ b/tests/Feature/Inspections/IgnoreNextLineSuppressorInspectionTest.php @@ -4,19 +4,18 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\CamelCaseFieldDefinitionInspection; use Worksome\Graphlint\Inspections\IgnoreNextLineSuppressorInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can skip next line22', function (SmartFileInfo $smartFileInfo) { +it('can skip next line22', function (SplFileInfo $smartFileInfo) { // Load in an inspection which should error, but will be skipped instead. $inspection = $this->app->get(CamelCaseFieldDefinitionInspection::class); $suppressor = $this->app->get(IgnoreNextLineSuppressorInspection::class); expect($smartFileInfo) ->toPassInspection($inspection, $suppressor); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/IgnoreNextLineSuppressorInspectionTest' )); diff --git a/tests/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest.php b/tests/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest.php index ecdf479..dddf833 100644 --- a/tests/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest.php +++ b/tests/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\InputSuffixInputObjectTypeDefinitionInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can rename input object type', function (SmartFileInfo $smartFileInfo) { +it('can rename input object type', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(InputSuffixInputObjectTypeDefinitionInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest' )); diff --git a/tests/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest.php b/tests/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest.php index d64ae55..54b91d1 100644 --- a/tests/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest.php +++ b/tests/Feature/Inspections/ModelDirectiveRequiresIdFieldInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\ModelDirectiveRequiresIdFieldInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can disallow enums', function (SmartFileInfo $smartFileInfo) { +it('can disallow enums', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(ModelDirectiveRequiresIdFieldInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/ModelDirectiveRequiresIdFieldInspectionTest' )); diff --git a/tests/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest.php b/tests/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest.php index 0d66748..63dc526 100644 --- a/tests/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest.php +++ b/tests/Feature/Inspections/MutationFieldArgumentNamedInputInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\MutationFieldArgumentNamedInputInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can rename argument field', function (SmartFileInfo $smartFileInfo) { +it('can rename argument field', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(MutationFieldArgumentNamedInputInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/MutationFieldArgumentNamedInputInspectionTest' )); diff --git a/tests/Feature/Inspections/NonNullableIdInspectionTest.php b/tests/Feature/Inspections/NonNullableIdInspectionTest.php index e20aa21..a7ddc4c 100644 --- a/tests/Feature/Inspections/NonNullableIdInspectionTest.php +++ b/tests/Feature/Inspections/NonNullableIdInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\NonNullableIdInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can make id non null', function (SmartFileInfo $smartFileInfo) { +it('can make id non null', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(NonNullableIdInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/NonNullableIdInspectionTest' )); diff --git a/tests/Feature/Inspections/NonNullableInsideListInspectionTest.php b/tests/Feature/Inspections/NonNullableInsideListInspectionTest.php index 78d31cf..788b8c1 100644 --- a/tests/Feature/Inspections/NonNullableInsideListInspectionTest.php +++ b/tests/Feature/Inspections/NonNullableInsideListInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\NonNullableInsideListInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can make type inside list non null', function (SmartFileInfo $smartFileInfo) { +it('can make type inside list non null', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(NonNullableInsideListInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/NonNullableInsideListInspectionTest' )); diff --git a/tests/Feature/Inspections/NonNullableListInspectionTest.php b/tests/Feature/Inspections/NonNullableListInspectionTest.php index b934c96..6e88bf1 100644 --- a/tests/Feature/Inspections/NonNullableListInspectionTest.php +++ b/tests/Feature/Inspections/NonNullableListInspectionTest.php @@ -4,15 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\NonNullableListInspection; use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can make list non null', function (SmartFileInfo $smartFileInfo) { +it('can make list non null', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(NonNullableListInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/NonNullableListInspectionTest' )); diff --git a/tests/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest.php b/tests/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest.php index 36aa76d..d637c18 100644 --- a/tests/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest.php +++ b/tests/Feature/Inspections/PascalCaseObjectTypeDefinitionInspectionTest.php @@ -4,16 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\PascalCaseObjectTypeDefinitionInspection; - use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can rename type', function (SmartFileInfo $smartFileInfo) { +it('can rename type', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(PascalCaseObjectTypeDefinitionInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/PascalCaseObjectTypeDefinitionInspectionTest' )); diff --git a/tests/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest.php b/tests/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest.php index 0d7cc13..9c642c9 100644 --- a/tests/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest.php +++ b/tests/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest.php @@ -4,15 +4,15 @@ namespace Worksome\Graphlint\Tests\Feature\Inspections; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Inspections\UpperSnakeCaseEnumCaseDefinitionInspection; use function Worksome\Graphlint\Tests\getFixturesForDirectory; -it('can rename type', function (SmartFileInfo $smartFileInfo) { +it('can rename type', function (SplFileInfo $smartFileInfo) { $inspection = $this->app->get(UpperSnakeCaseEnumCaseDefinitionInspection::class); expect($smartFileInfo) ->toPassInspection($inspection); -})->with(getFixturesForDirectory( +})->with(fn () => getFixturesForDirectory( __DIR__ . '/../../../test-resources/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest' )); diff --git a/tests/Pest.php b/tests/Pest.php index 8daf640..f2c09dc 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -8,9 +8,8 @@ use GraphQL\Language\Printer; use Illuminate\Support\Collection; use Illuminate\Support\Str; -use Symplify\EasyTesting\DataProvider\StaticFixtureFinder; -use Symplify\EasyTesting\StaticFixtureSplitter; -use Symplify\SmartFileSystem\SmartFileInfo; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Finder\SplFileInfo; use Worksome\Graphlint\Analyser\Analyser; use Worksome\Graphlint\Contracts\SuppressorInspection; use Worksome\Graphlint\Fixer\Fixer; @@ -29,6 +28,7 @@ | */ uses(TestCase::class)->in('Feature'); + /* |-------------------------------------------------------------------------- | Expectations @@ -43,20 +43,19 @@ Inspection $inspection, SuppressorInspection|null $suppressorInspection = null, ) { - $smartFileInfo = $this->value; - - $inputAndExpected = StaticFixtureSplitter::splitFileInfoToInputAndExpected($smartFileInfo); + /** @var SplFileInfo $file */ + $file = $this->value; $analyser = new Analyser(); $result = $analyser->analyse( - Parser::parse($inputAndExpected->getInput()), + Parser::parse($file->getContents()), new CompiledVisitorCollector( [$inspection], array_filter([$suppressorInspection]), ), ); - if (Str::endsWith($smartFileInfo->getRealPath(), '.skip.graphql.inc')) { + if (Str::endsWith($file->getRealPath(), '.skip.graphql.inc')) { $descriptions = Collection::make($result->getProblemsHolder()->getProblems()) ->map(fn(ProblemDescriptor $descriptor) => $descriptor->getDescription()) ->all(); @@ -72,9 +71,7 @@ $fixerResult = $fixer->fix($result); $schemaPrint = Printer::doPrint($fixerResult->getDocumentNode()); - expect($schemaPrint)->toEqual( - $inputAndExpected->getExpected() - ); + expect($schemaPrint)->toMatchSnapshot(); }); /* @@ -88,24 +85,10 @@ | */ -/** - * @return array> - */ -function getFixturesForDirectory(string $directory): array +function getFixturesForDirectory(string $directory): Finder { - /** @var iterable> $args */ - $args = StaticFixtureFinder::yieldDirectory( - $directory, - '*.graphql.inc', - ); - - $values = []; - - foreach ($args as $files) { - $file = $files[0]; - - $values[$file->getFilename()] = $files; - } - - return $values; + return Finder::create() + ->files() + ->name('*.graphql.inc') + ->in($directory); } From 2251edf9610e1e8e2f0772fd9e06143a793c3b63 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 3 Jul 2024 09:42:47 +0200 Subject: [PATCH 5/6] Update snapshots --- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 4 ---- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 5 +---- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 2 +- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 1 + ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 5 ++++- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 5 +---- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 5 ++++- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 5 ++++- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 4 ---- ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 1 + ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 1 - ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 4 ++++ ..._Symfony_Component_Finder_SplFileInfo_Object_______.snap} | 0 ..._Symfony_Component_Finder_SplFileInfo_Object_______.snap} | 0 ..._Symfony_Component_Finder_SplFileInfo_Object_______.snap} | 0 ...__Symfony_Component_Finder_SplFileInfo_Object_______.snap | 2 +- ..._Symfony_Component_Finder_SplFileInfo_Object_______.snap} | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap delete mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___7___Symfony_Component_Finder_SplFileInfo_Object_______.snap delete mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap create mode 100644 tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___9___Symfony_Component_Finder_SplFileInfo_Object_______.snap rename tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/{it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap => it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap} (100%) rename tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/{it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap => it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap} (100%) rename tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/{it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap => it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap} (100%) rename tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/{it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap => it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap} (53%) diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap deleted file mode 100644 index 386017c..0000000 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___10___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ /dev/null @@ -1,4 +0,0 @@ -enum Some { - "A test" - TEST -} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap index 2c63584..08ba028 100644 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___11___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1,4 +1 @@ -"Input for a user" -input UserInput { - name: String! -} +type User diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap index 8f601b1..ed07555 100644 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___12___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1 +1 @@ -scalar something +input Something diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..541235e --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +interface Admin diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap index 9300c54..ace1cd6 100644 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1 +1,4 @@ -union Pro = User | Company +"Some user" +type User { + name: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap index 0d28cee..8f601b1 100644 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1,4 +1 @@ -"Allowed cakes" -enum Cake { - CHOCOLATE -} +scalar something diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap index 541235e..386017c 100644 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1 +1,4 @@ -interface Admin +enum Some { + "A test" + TEST +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap index 08ba028..0d28cee 100644 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1 +1,4 @@ -type User +"Allowed cakes" +enum Cake { + CHOCOLATE +} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap deleted file mode 100644 index ace1cd6..0000000 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___6___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ /dev/null @@ -1,4 +0,0 @@ -"Some user" -type User { - name: String! -} diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___7___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___7___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..9300c54 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___7___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1 @@ +union Pro = User | Company diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap deleted file mode 100644 index ed07555..0000000 --- a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___8___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ /dev/null @@ -1 +0,0 @@ -input Something diff --git a/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___9___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___9___Symfony_Component_Finder_SplFileInfo_Object_______.snap new file mode 100644 index 0000000..2c63584 --- /dev/null +++ b/tests/.pest/snapshots/Feature/Inspections/DescriptionRequiredInspectionTest/it_can_require_description_with_data_set___Symfony_Component_Finder_SplFileInfo___9___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -0,0 +1,4 @@ +"Input for a user" +input UserInput { + name: String! +} diff --git a/tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap similarity index 100% rename from tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap rename to tests/.pest/snapshots/Feature/Inspections/InputSuffixInputObjectTypeDefinitionInspectionTest/it_can_rename_input_object_type_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap diff --git a/tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap similarity index 100% rename from tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap rename to tests/.pest/snapshots/Feature/Inspections/NonNullableInsideListInspectionTest/it_can_make_type_inside_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap diff --git a/tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap similarity index 100% rename from tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___4___Symfony_Component_Finder_SplFileInfo_Object_______.snap rename to tests/.pest/snapshots/Feature/Inspections/NonNullableListInspectionTest/it_can_make_list_non_null_with_data_set___Symfony_Component_Finder_SplFileInfo___2___Symfony_Component_Finder_SplFileInfo_Object_______.snap diff --git a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap index c330b9b..a72a646 100644 --- a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___1___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1,3 +1,3 @@ enum Status { - IN_PROGRESS + ACTIVE } diff --git a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap similarity index 53% rename from tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap rename to tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap index a72a646..c330b9b 100644 --- a/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___3___Symfony_Component_Finder_SplFileInfo_Object_______.snap +++ b/tests/.pest/snapshots/Feature/Inspections/UpperSnakeCaseEnumCaseDefinitionInspectionTest/it_can_rename_type_with_data_set___Symfony_Component_Finder_SplFileInfo___5___Symfony_Component_Finder_SplFileInfo_Object_______.snap @@ -1,3 +1,3 @@ enum Status { - ACTIVE + IN_PROGRESS } From a9e48c3baacd23f4aa84e8757b93be2a59746207 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 3 Jul 2024 09:43:07 +0200 Subject: [PATCH 6/6] Recommend composer update locally --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97b6d3b..d29a51e 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,6 @@ This package ships with a docker configuration for running the tests. Assuming you have cloned the repository and have docker and docker-compose installed, you can run the tests by running ```bash -docker-compose run --rm composer install # Only needed the first time +docker-compose run --rm composer update # Only needed the first time docker-compose run --rm pest ```