Skip to content

Commit

Permalink
test: update to remove deprecated Easy Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Apr 22, 2024
1 parent b55950a commit 9eb71e3
Show file tree
Hide file tree
Showing 48 changed files with 114 additions and 132 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
type User {
full_name: String!
}
-----
type User {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
input User {
fullName: String!
}
-----
input UserInput {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type User @model {
name: String!
}
-----
type User @model {
id: ID!
name: String!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Mutation {
version(environment: String!): String!
}

-----
type Mutation {
version(input: String!): String!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Person {
id: ID
}

-----
type Person {
id: ID!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Person {
friends: [Person]!
}

-----
type Person {
friends: [Person!]!
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
type Person {
friends: [Person]
}

-----
type Person {
friends: [Person]!
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
type user_information {
fullName: String!
}
-----
type UserInformation {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
inProgress
}
-----
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
in_progress
}
-----
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
Active
}
-----
enum Status {
ACTIVE
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
enum Status {
InProgress
}
-----
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type User {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enum Some {
"A test"
TEST
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Input for a user"
input UserInput {
name: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scalar something
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
union Pro = User | Company
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Allowed cakes"
enum Cake {
CHOCOLATE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
interface Admin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type User
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Some user"
type User {
name: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
input Something
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enum MyEnum {
GOOD
BAD
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
input UserInput {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type User @model {
id: ID!
name: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Mutation {
version(input: String!): String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Person {
id: ID!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Person {
friends: [Person!]!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Person {
friends: [Person]!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type UserInformation {
fullName: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
IN_PROGRESS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
ACTIVE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Status {
IN_PROGRESS
}
9 changes: 4 additions & 5 deletions tests/Feature/Inspections/CamelCaseFieldInspectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
7 changes: 3 additions & 4 deletions tests/Feature/Inspections/DisallowEnumInspectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
7 changes: 3 additions & 4 deletions tests/Feature/Inspections/NonNullableIdInspectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
6 changes: 3 additions & 3 deletions tests/Feature/Inspections/NonNullableListInspectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
));
Loading

0 comments on commit 9eb71e3

Please sign in to comment.