-
Notifications
You must be signed in to change notification settings - Fork 20
Upgrade dependencies to prepare 5.0.0 release #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dsavina
merged 10 commits into
thecodingmachine:master
from
dsavina:chore/general-upgrade
Oct 29, 2021
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
30eccf2
Rename 'Graphqlite' to 'GraphQLite'
dsavina 0cc24e8
Remove dead class copied from 'thecodingmachine/graphqlite-bundle'
dsavina 2da130a
[dev][vendor] Upgrade 'doctrine/coding-standard' to ^9.0
dsavina 1b94f23
[fix][vendor] Contracts only available since Symfony 4.2 (use of 'Sym…
dsavina 40c7ab4
[vendor] Upgrade 'thecodingmachine/graphqlite' to ^5.0
dsavina 3044088
[ci] Update Travis configuration (PHP 8.0 support)
dsavina 9a0142e
[codestyle] Fix codestyles (missing newline, superfluous space)
dsavina 2469b3b
[fix] Handle possibly empty strings instead of null
dsavina d0aa86f
[fix][tests] Update imports
dsavina a89df76
[version] Bump branch alias to 5.0.x
dsavina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
<?php | ||
|
||
|
||
namespace TheCodingMachine\Graphqlite\Validator; | ||
namespace TheCodingMachine\GraphQLite\Validator; | ||
|
||
|
||
use Doctrine\Common\Annotations\AnnotationReader; | ||
use GraphQL\Error\Debug; | ||
use GraphQL\Error\DebugFlag; | ||
use GraphQL\GraphQL; | ||
use GraphQL\Type\Schema; | ||
use Mouf\Picotainer\Picotainer; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerInterface; | ||
use Symfony\Component\Cache\Adapter\ArrayAdapter; | ||
use Symfony\Component\Cache\Adapter\Psr16Adapter; | ||
use Symfony\Component\Cache\Psr16Cache; | ||
use Symfony\Component\Cache\Simple\ArrayCache; | ||
use Symfony\Component\Translation\Translator; | ||
use Symfony\Component\Validator\ContainerConstraintValidatorFactory; | ||
use Symfony\Component\Validator\Validator\ValidatorInterface; | ||
use Symfony\Component\Validator\ValidatorBuilder; | ||
use Symfony\Contracts\Translation\TranslatorInterface; | ||
use TheCodingMachine\GraphQLite\Containers\BasicAutoWiringContainer; | ||
use TheCodingMachine\GraphQLite\Containers\EmptyContainer; | ||
use TheCodingMachine\GraphQLite\Exceptions\WebonyxErrorHandler; | ||
use TheCodingMachine\GraphQLite\SchemaFactory; | ||
use TheCodingMachine\Graphqlite\Validator\Fixtures\Controllers\UserController; | ||
use TheCodingMachine\Graphqlite\Validator\Mappers\Parameters\AssertParameterMiddleware; | ||
use TheCodingMachine\Graphqlite\Validator\Mappers\Parameters\InvalidAssertionAnnotationException; | ||
use function var_dump; | ||
use function var_export; | ||
use const JSON_PRETTY_PRINT; | ||
use TheCodingMachine\GraphQLite\Validator\Fixtures\Controllers\UserController; | ||
use TheCodingMachine\GraphQLite\Validator\Mappers\Parameters\AssertParameterMiddleware; | ||
use TheCodingMachine\GraphQLite\Validator\Mappers\Parameters\InvalidAssertionAnnotationException; | ||
|
||
class IntegrationTest extends TestCase | ||
{ | ||
|
@@ -51,8 +45,8 @@ private function getSchemaFactory(): SchemaFactory | |
]); | ||
|
||
$schemaFactory = new SchemaFactory(new Psr16Cache(new ArrayAdapter()), new BasicAutoWiringContainer($container)); | ||
$schemaFactory->addControllerNamespace('TheCodingMachine\Graphqlite\Validator\Fixtures\Controllers'); | ||
$schemaFactory->addTypeNamespace('TheCodingMachine\Graphqlite\Validator\Fixtures\Types'); | ||
$schemaFactory->addControllerNamespace('TheCodingMachine\GraphQLite\Validator\Fixtures\Controllers'); | ||
$schemaFactory->addTypeNamespace('TheCodingMachine\GraphQLite\Validator\Fixtures\Types'); | ||
$schemaFactory->addParameterMiddleware(new AssertParameterMiddleware(new ContainerConstraintValidatorFactory($container), $container->get(ValidatorInterface::class), $container->get(TranslatorInterface::class))); | ||
|
||
return $schemaFactory; | ||
|
@@ -83,7 +77,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 +106,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 +129,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('[email protected]', $data['findByMail']['email']); | ||
|
||
// Test default parameter | ||
|
@@ -154,19 +148,19 @@ 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('[email protected]', $data['findByMail']['email']); | ||
|
||
} | ||
|
||
public function testException(): void | ||
{ | ||
$schemaFactory = $this->getSchemaFactory(); | ||
$schemaFactory->addControllerNamespace('TheCodingMachine\Graphqlite\Validator\Fixtures\InvalidControllers'); | ||
$schemaFactory->addControllerNamespace('TheCodingMachine\GraphQLite\Validator\Fixtures\InvalidControllers'); | ||
$schema = $schemaFactory->createSchema(); | ||
|
||
$this->expectException(InvalidAssertionAnnotationException::class); | ||
$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.'); | ||
$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(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I was too quick in my PR with fixing the unit tests like this: https://github.com/thecodingmachine/graphqlite-symfony-validator-bridge/pull/59/files#diff-02c6aa7ec0feccd57d011c4811afe16fab28e8c1e7e517028100a96fd7a4d3f5R18-R21
This makes more sense.