diff --git a/composer.json b/composer.json index 73f7040..bd33a51 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require" : { "php" : ">=7.2", - "thecodingmachine/graphqlite" : "^4.1", + "thecodingmachine/graphqlite" : "^5.0", "symfony/validator": "^4 | ^5", "doctrine/annotations": "^1.6" }, @@ -27,8 +27,8 @@ "mouf/picotainer": "^1.1", "phpstan/phpstan": "^0.12.14", "php-coveralls/php-coveralls": "^2.1.0", - "symfony/translation": "^4", - "doctrine/coding-standard": "^7.0" + "symfony/translation": "^4 || ^5", + "doctrine/coding-standard": "^8.2 || ^9.0" }, "scripts": { "phpstan": "phpstan analyse src/ -c phpstan.neon --level=7 --no-progress", @@ -48,7 +48,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.1.x-dev" + "dev-master": "5.0.x-dev" } }, "minimum-stability": "dev", diff --git a/tests/ConstraintValidationExceptionTest.php b/tests/ConstraintValidationExceptionTest.php index 75ccc93..5469397 100644 --- a/tests/ConstraintValidationExceptionTest.php +++ b/tests/ConstraintValidationExceptionTest.php @@ -15,9 +15,9 @@ public function testException() $this->assertSame(400, $exception->getCode()); $this->assertTrue($exception->isClientSafe()); $this->assertSame('Validate', $exception->getCategory()); - $this->assertSame(['code' => 'myCode'], $exception->getExtensions()); + $this->assertSame(['code' => 'myCode', 'field' => ''], $exception->getExtensions()); $exception = new ConstraintViolationException(new ConstraintViolation('foo', 'foo {bar}', ['bar' => 'baz'], null, null, 'invalidValue')); - $this->assertSame([], $exception->getExtensions()); + $this->assertSame(['field' => ''], $exception->getExtensions()); } } diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index ed3d088..e61513d 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -5,7 +5,7 @@ use Doctrine\Common\Annotations\AnnotationReader; -use GraphQL\Error\Debug; +use GraphQL\Error\DebugFlag; use GraphQL\GraphQL; use GraphQL\Type\Schema; use Mouf\Picotainer\Picotainer; @@ -83,7 +83,7 @@ public function testEndToEndThrowException(): void $result->setErrorsHandler([WebonyxErrorHandler::class, 'errorHandler']); $result->setErrorFormatter([WebonyxErrorHandler::class, 'errorFormatter']); - $errors = $result->toArray(Debug::RETHROW_UNSAFE_EXCEPTIONS)['errors']; + $errors = $result->toArray(DebugFlag::RETHROW_UNSAFE_EXCEPTIONS)['errors']; $this->assertSame('The email \'"foofgdjkerbrtehrthjker.com"\' is not a valid email.', $errors[0]['message']); $this->assertSame('email', $errors[0]['extensions']['field']); $this->assertSame('Validate', $errors[0]['extensions']['category']); @@ -112,7 +112,7 @@ public function testEndToEndAssert(): void $result->setErrorsHandler([WebonyxErrorHandler::class, 'errorHandler']); $result->setErrorFormatter([WebonyxErrorHandler::class, 'errorFormatter']); - $errors = $result->toArray(Debug::RETHROW_UNSAFE_EXCEPTIONS)['errors']; + $errors = $result->toArray(DebugFlag::RETHROW_UNSAFE_EXCEPTIONS)['errors']; // TODO: find why message is not in French... $this->assertSame('This value is not a valid email address.', $errors[0]['message']); @@ -135,7 +135,7 @@ public function testEndToEndAssert(): void $result->setErrorsHandler([WebonyxErrorHandler::class, 'errorHandler']); $result->setErrorFormatter([WebonyxErrorHandler::class, 'errorFormatter']); - $data = $result->toArray(Debug::RETHROW_UNSAFE_EXCEPTIONS)['data']; + $data = $result->toArray(DebugFlag::RETHROW_UNSAFE_EXCEPTIONS)['data']; $this->assertSame('valid@valid.com', $data['findByMail']['email']); // Test default parameter @@ -154,7 +154,7 @@ public function testEndToEndAssert(): void $result->setErrorsHandler([WebonyxErrorHandler::class, 'errorHandler']); $result->setErrorFormatter([WebonyxErrorHandler::class, 'errorFormatter']); - $data = $result->toArray(Debug::RETHROW_UNSAFE_EXCEPTIONS)['data']; + $data = $result->toArray(DebugFlag::RETHROW_UNSAFE_EXCEPTIONS)['data']; $this->assertSame('a@a.com', $data['findByMail']['email']); } @@ -169,4 +169,4 @@ public function testException(): void $this->expectExceptionMessage('In method TheCodingMachine\Graphqlite\Validator\Fixtures\InvalidControllers\InvalidController::invalid(), the @Assert annotation is targeting parameter "$resolveInfo". You cannot target this parameter because it is not part of the GraphQL Input type. You can only assert parameters coming from the end user.'); $schema->validate(); } -} \ No newline at end of file +}