We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -111,38 +111,3 @@ |
||
| 111 | 111 | |
| 112 | 112 | // this is the part is why we must make this test run in separate process |
| 113 | 113 | $query = <<<'EOF' |
| 114 | - mutation { |
|
| 115 | - conflictingValidatorNamespaces(test: "123", test2: "1", test3: "4") |
|
| 116 | - } |
|
| 117 | - EOF; |
|
| 118 | - |
|
| 119 | - $response = static::query( |
|
| 120 | - $query, |
|
| 121 | - self::USER_RYAN, |
|
| 122 | - 'conflictingValidatorNamespaces' |
|
| 123 | - )->getResponse()->getContent(); |
|
| 124 | - |
|
| 125 | - $this->assertEquals('{"data":{"conflictingValidatorNamespaces":true}}', $response); |
|
| 126 | - // end part |
|
| 127 | - |
|
| 128 | - // Validate definition file |
|
| 129 | - /** @var string $definitionFile */ |
|
| 130 | - $definitionFile = file_get_contents($kernel->getCacheDir().'/overblog/graphql-bundle/__definitions__/MutationType.php'); |
|
| 131 | - |
|
| 132 | - $this->assertStringContainsString( |
|
| 133 | - 'use Symfony\Component\Validator\Constraints as SymfonyConstraints;', |
|
| 134 | - $definitionFile, |
|
| 135 | - 'Generated definition file should contain import of Symfony\Component\Validator\Constraints aliased as SymfonyConstraints' |
|
| 136 | - ); |
|
| 137 | - $this->assertStringNotContainsString( |
|
| 138 | - 'use '.Validator\CustomValidator1\Constraint::class, |
|
| 139 | - $definitionFile, |
|
| 140 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 141 | - ); |
|
| 142 | - $this->assertStringNotContainsString( |
|
| 143 | - 'use '.Validator\CustomValidator2\Constraint::class, |
|
| 144 | - $definitionFile, |
|
| 145 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 146 | - ); |
|
| 147 | - } |
|
| 148 | -} |
|
@@ -111,38 +111,3 @@ |
||
| 111 | 111 | |
| 112 | 112 | // this is the part is why we must make this test run in separate process |
| 113 | 113 | $query = <<<'EOF' |
| 114 | - mutation { |
|
| 115 | - conflictingValidatorNamespaces(test: "123", test2: "1", test3: "4") |
|
| 116 | - } |
|
| 117 | - EOF; |
|
| 118 | - |
|
| 119 | - $response = static::query( |
|
| 120 | - $query, |
|
| 121 | - self::USER_RYAN, |
|
| 122 | - 'conflictingValidatorNamespaces' |
|
| 123 | - )->getResponse()->getContent(); |
|
| 124 | - |
|
| 125 | - $this->assertEquals('{"data":{"conflictingValidatorNamespaces":true}}', $response); |
|
| 126 | - // end part |
|
| 127 | - |
|
| 128 | - // Validate definition file |
|
| 129 | - /** @var string $definitionFile */ |
|
| 130 | - $definitionFile = file_get_contents($kernel->getCacheDir().'/overblog/graphql-bundle/__definitions__/MutationType.php'); |
|
| 131 | - |
|
| 132 | - $this->assertStringContainsString( |
|
| 133 | - 'use Symfony\Component\Validator\Constraints as SymfonyConstraints;', |
|
| 134 | - $definitionFile, |
|
| 135 | - 'Generated definition file should contain import of Symfony\Component\Validator\Constraints aliased as SymfonyConstraints' |
|
| 136 | - ); |
|
| 137 | - $this->assertStringNotContainsString( |
|
| 138 | - 'use '.Validator\CustomValidator1\Constraint::class, |
|
| 139 | - $definitionFile, |
|
| 140 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 141 | - ); |
|
| 142 | - $this->assertStringNotContainsString( |
|
| 143 | - 'use '.Validator\CustomValidator2\Constraint::class, |
|
| 144 | - $definitionFile, |
|
| 145 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 146 | - ); |
|
| 147 | - } |
|
| 148 | -} |
|
@@ -111,38 +111,3 @@ |
||
| 111 | 111 | |
| 112 | 112 | // this is the part is why we must make this test run in separate process |
| 113 | 113 | $query = <<<'EOF' |
| 114 | - mutation { |
|
| 115 | - conflictingValidatorNamespaces(test: "123", test2: "1", test3: "4") |
|
| 116 | - } |
|
| 117 | - EOF; |
|
| 118 | - |
|
| 119 | - $response = static::query( |
|
| 120 | - $query, |
|
| 121 | - self::USER_RYAN, |
|
| 122 | - 'conflictingValidatorNamespaces' |
|
| 123 | - )->getResponse()->getContent(); |
|
| 124 | - |
|
| 125 | - $this->assertEquals('{"data":{"conflictingValidatorNamespaces":true}}', $response); |
|
| 126 | - // end part |
|
| 127 | - |
|
| 128 | - // Validate definition file |
|
| 129 | - /** @var string $definitionFile */ |
|
| 130 | - $definitionFile = file_get_contents($kernel->getCacheDir().'/overblog/graphql-bundle/__definitions__/MutationType.php'); |
|
| 131 | - |
|
| 132 | - $this->assertStringContainsString( |
|
| 133 | - 'use Symfony\Component\Validator\Constraints as SymfonyConstraints;', |
|
| 134 | - $definitionFile, |
|
| 135 | - 'Generated definition file should contain import of Symfony\Component\Validator\Constraints aliased as SymfonyConstraints' |
|
| 136 | - ); |
|
| 137 | - $this->assertStringNotContainsString( |
|
| 138 | - 'use '.Validator\CustomValidator1\Constraint::class, |
|
| 139 | - $definitionFile, |
|
| 140 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 141 | - ); |
|
| 142 | - $this->assertStringNotContainsString( |
|
| 143 | - 'use '.Validator\CustomValidator2\Constraint::class, |
|
| 144 | - $definitionFile, |
|
| 145 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 146 | - ); |
|
| 147 | - } |
|
| 148 | -} |
|
@@ -111,38 +111,3 @@ |
||
| 111 | 111 | |
| 112 | 112 | // this is the part is why we must make this test run in separate process |
| 113 | 113 | $query = <<<'EOF' |
| 114 | - mutation { |
|
| 115 | - conflictingValidatorNamespaces(test: "123", test2: "1", test3: "4") |
|
| 116 | - } |
|
| 117 | - EOF; |
|
| 118 | - |
|
| 119 | - $response = static::query( |
|
| 120 | - $query, |
|
| 121 | - self::USER_RYAN, |
|
| 122 | - 'conflictingValidatorNamespaces' |
|
| 123 | - )->getResponse()->getContent(); |
|
| 124 | - |
|
| 125 | - $this->assertEquals('{"data":{"conflictingValidatorNamespaces":true}}', $response); |
|
| 126 | - // end part |
|
| 127 | - |
|
| 128 | - // Validate definition file |
|
| 129 | - /** @var string $definitionFile */ |
|
| 130 | - $definitionFile = file_get_contents($kernel->getCacheDir().'/overblog/graphql-bundle/__definitions__/MutationType.php'); |
|
| 131 | - |
|
| 132 | - $this->assertStringContainsString( |
|
| 133 | - 'use Symfony\Component\Validator\Constraints as SymfonyConstraints;', |
|
| 134 | - $definitionFile, |
|
| 135 | - 'Generated definition file should contain import of Symfony\Component\Validator\Constraints aliased as SymfonyConstraints' |
|
| 136 | - ); |
|
| 137 | - $this->assertStringNotContainsString( |
|
| 138 | - 'use '.Validator\CustomValidator1\Constraint::class, |
|
| 139 | - $definitionFile, |
|
| 140 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 141 | - ); |
|
| 142 | - $this->assertStringNotContainsString( |
|
| 143 | - 'use '.Validator\CustomValidator2\Constraint::class, |
|
| 144 | - $definitionFile, |
|
| 145 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 146 | - ); |
|
| 147 | - } |
|
| 148 | -} |
|
@@ -111,38 +111,3 @@ |
||
| 111 | 111 | |
| 112 | 112 | // this is the part is why we must make this test run in separate process |
| 113 | 113 | $query = <<<'EOF' |
| 114 | - mutation { |
|
| 115 | - conflictingValidatorNamespaces(test: "123", test2: "1", test3: "4") |
|
| 116 | - } |
|
| 117 | - EOF; |
|
| 118 | - |
|
| 119 | - $response = static::query( |
|
| 120 | - $query, |
|
| 121 | - self::USER_RYAN, |
|
| 122 | - 'conflictingValidatorNamespaces' |
|
| 123 | - )->getResponse()->getContent(); |
|
| 124 | - |
|
| 125 | - $this->assertEquals('{"data":{"conflictingValidatorNamespaces":true}}', $response); |
|
| 126 | - // end part |
|
| 127 | - |
|
| 128 | - // Validate definition file |
|
| 129 | - /** @var string $definitionFile */ |
|
| 130 | - $definitionFile = file_get_contents($kernel->getCacheDir().'/overblog/graphql-bundle/__definitions__/MutationType.php'); |
|
| 131 | - |
|
| 132 | - $this->assertStringContainsString( |
|
| 133 | - 'use Symfony\Component\Validator\Constraints as SymfonyConstraints;', |
|
| 134 | - $definitionFile, |
|
| 135 | - 'Generated definition file should contain import of Symfony\Component\Validator\Constraints aliased as SymfonyConstraints' |
|
| 136 | - ); |
|
| 137 | - $this->assertStringNotContainsString( |
|
| 138 | - 'use '.Validator\CustomValidator1\Constraint::class, |
|
| 139 | - $definitionFile, |
|
| 140 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 141 | - ); |
|
| 142 | - $this->assertStringNotContainsString( |
|
| 143 | - 'use '.Validator\CustomValidator2\Constraint::class, |
|
| 144 | - $definitionFile, |
|
| 145 | - 'Generated definition file should not contain imports of custom constraints, FQCN should be used instead' |
|
| 146 | - ); |
|
| 147 | - } |
|
| 148 | -} |
|
@@ -26,65 +26,3 @@ |
||
| 26 | 26 | $this->assertSame([['node' => ['username' => 'user1']]], $result['data']['users']['edges']); |
| 27 | 27 | |
| 28 | 28 | $query = <<<'EOF' |
| 29 | - mutation M { |
|
| 30 | - addUser(input: {username: "user1"}) { |
|
| 31 | - user { |
|
| 32 | - username |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 36 | - EOF; |
|
| 37 | - |
|
| 38 | - $expectedData = [ |
|
| 39 | - 'addUser' => [ |
|
| 40 | - 'user' => ['username' => 'user1'], |
|
| 41 | - ], |
|
| 42 | - ]; |
|
| 43 | - |
|
| 44 | - $this->assertGraphQL($query, $expectedData, null, [], 'public'); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function testInternalSchema(): void |
|
| 48 | - { |
|
| 49 | - $result = $this->executeGraphQLRequest('{bar foo}', [], 'internal'); |
|
| 50 | - $this->assertSame('bar', $result['data']['bar']); |
|
| 51 | - $this->assertSame('foo', $result['data']['foo']); |
|
| 52 | - $this->assertSchemaQueryTypeName('InternalQuery'); |
|
| 53 | - |
|
| 54 | - $result = $this->executeGraphQLRequest('{users{edges{node{username email}}}}', [], 'internal'); |
|
| 55 | - $this->assertSame([['node' => ['username' => 'user1', 'email' => 'topsecret']]], $result['data']['users']['edges']); |
|
| 56 | - |
|
| 57 | - $query = <<<'EOF' |
|
| 58 | - mutation M { |
|
| 59 | - addUser(input: {username: "user1"}) { |
|
| 60 | - user { |
|
| 61 | - username |
|
| 62 | ||
| 63 | - } |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - EOF; |
|
| 67 | - |
|
| 68 | - $expectedData = [ |
|
| 69 | - 'addUser' => [ |
|
| 70 | - 'user' => ['username' => 'user1', 'email' => 'email1'], |
|
| 71 | - ], |
|
| 72 | - ]; |
|
| 73 | - |
|
| 74 | - $this->assertGraphQL($query, $expectedData, null, [], 'internal'); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function testUnknownTypeShouldReturnNull(): void |
|
| 78 | - { |
|
| 79 | - // @phpstan-ignore-next-line |
|
| 80 | - $schema = $this->getContainer()->get('overblog_graphql.request_executor')->getSchema('public'); |
|
| 81 | - $this->assertNull($schema->getType('unknown')); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - private function assertSchemaQueryTypeName(string $typeName): void |
|
| 85 | - { |
|
| 86 | - // @phpstan-ignore-next-line |
|
| 87 | - $query = $this->getContainer()->get('overblog_graphql.type_resolver')->resolve($typeName); |
|
| 88 | - $this->assertSame('Query', $query->name); |
|
| 89 | - } |
|
| 90 | -} |
|
@@ -26,65 +26,3 @@ |
||
| 26 | 26 | $this->assertSame([['node' => ['username' => 'user1']]], $result['data']['users']['edges']); |
| 27 | 27 | |
| 28 | 28 | $query = <<<'EOF' |
| 29 | - mutation M { |
|
| 30 | - addUser(input: {username: "user1"}) { |
|
| 31 | - user { |
|
| 32 | - username |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 36 | - EOF; |
|
| 37 | - |
|
| 38 | - $expectedData = [ |
|
| 39 | - 'addUser' => [ |
|
| 40 | - 'user' => ['username' => 'user1'], |
|
| 41 | - ], |
|
| 42 | - ]; |
|
| 43 | - |
|
| 44 | - $this->assertGraphQL($query, $expectedData, null, [], 'public'); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function testInternalSchema(): void |
|
| 48 | - { |
|
| 49 | - $result = $this->executeGraphQLRequest('{bar foo}', [], 'internal'); |
|
| 50 | - $this->assertSame('bar', $result['data']['bar']); |
|
| 51 | - $this->assertSame('foo', $result['data']['foo']); |
|
| 52 | - $this->assertSchemaQueryTypeName('InternalQuery'); |
|
| 53 | - |
|
| 54 | - $result = $this->executeGraphQLRequest('{users{edges{node{username email}}}}', [], 'internal'); |
|
| 55 | - $this->assertSame([['node' => ['username' => 'user1', 'email' => 'topsecret']]], $result['data']['users']['edges']); |
|
| 56 | - |
|
| 57 | - $query = <<<'EOF' |
|
| 58 | - mutation M { |
|
| 59 | - addUser(input: {username: "user1"}) { |
|
| 60 | - user { |
|
| 61 | - username |
|
| 62 | ||
| 63 | - } |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - EOF; |
|
| 67 | - |
|
| 68 | - $expectedData = [ |
|
| 69 | - 'addUser' => [ |
|
| 70 | - 'user' => ['username' => 'user1', 'email' => 'email1'], |
|
| 71 | - ], |
|
| 72 | - ]; |
|
| 73 | - |
|
| 74 | - $this->assertGraphQL($query, $expectedData, null, [], 'internal'); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function testUnknownTypeShouldReturnNull(): void |
|
| 78 | - { |
|
| 79 | - // @phpstan-ignore-next-line |
|
| 80 | - $schema = $this->getContainer()->get('overblog_graphql.request_executor')->getSchema('public'); |
|
| 81 | - $this->assertNull($schema->getType('unknown')); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - private function assertSchemaQueryTypeName(string $typeName): void |
|
| 85 | - { |
|
| 86 | - // @phpstan-ignore-next-line |
|
| 87 | - $query = $this->getContainer()->get('overblog_graphql.type_resolver')->resolve($typeName); |
|
| 88 | - $this->assertSame('Query', $query->name); |
|
| 89 | - } |
|
| 90 | -} |
|
@@ -26,65 +26,3 @@ |
||
| 26 | 26 | $this->assertSame([['node' => ['username' => 'user1']]], $result['data']['users']['edges']); |
| 27 | 27 | |
| 28 | 28 | $query = <<<'EOF' |
| 29 | - mutation M { |
|
| 30 | - addUser(input: {username: "user1"}) { |
|
| 31 | - user { |
|
| 32 | - username |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 36 | - EOF; |
|
| 37 | - |
|
| 38 | - $expectedData = [ |
|
| 39 | - 'addUser' => [ |
|
| 40 | - 'user' => ['username' => 'user1'], |
|
| 41 | - ], |
|
| 42 | - ]; |
|
| 43 | - |
|
| 44 | - $this->assertGraphQL($query, $expectedData, null, [], 'public'); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function testInternalSchema(): void |
|
| 48 | - { |
|
| 49 | - $result = $this->executeGraphQLRequest('{bar foo}', [], 'internal'); |
|
| 50 | - $this->assertSame('bar', $result['data']['bar']); |
|
| 51 | - $this->assertSame('foo', $result['data']['foo']); |
|
| 52 | - $this->assertSchemaQueryTypeName('InternalQuery'); |
|
| 53 | - |
|
| 54 | - $result = $this->executeGraphQLRequest('{users{edges{node{username email}}}}', [], 'internal'); |
|
| 55 | - $this->assertSame([['node' => ['username' => 'user1', 'email' => 'topsecret']]], $result['data']['users']['edges']); |
|
| 56 | - |
|
| 57 | - $query = <<<'EOF' |
|
| 58 | - mutation M { |
|
| 59 | - addUser(input: {username: "user1"}) { |
|
| 60 | - user { |
|
| 61 | - username |
|
| 62 | ||
| 63 | - } |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - EOF; |
|
| 67 | - |
|
| 68 | - $expectedData = [ |
|
| 69 | - 'addUser' => [ |
|
| 70 | - 'user' => ['username' => 'user1', 'email' => 'email1'], |
|
| 71 | - ], |
|
| 72 | - ]; |
|
| 73 | - |
|
| 74 | - $this->assertGraphQL($query, $expectedData, null, [], 'internal'); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function testUnknownTypeShouldReturnNull(): void |
|
| 78 | - { |
|
| 79 | - // @phpstan-ignore-next-line |
|
| 80 | - $schema = $this->getContainer()->get('overblog_graphql.request_executor')->getSchema('public'); |
|
| 81 | - $this->assertNull($schema->getType('unknown')); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - private function assertSchemaQueryTypeName(string $typeName): void |
|
| 85 | - { |
|
| 86 | - // @phpstan-ignore-next-line |
|
| 87 | - $query = $this->getContainer()->get('overblog_graphql.type_resolver')->resolve($typeName); |
|
| 88 | - $this->assertSame('Query', $query->name); |
|
| 89 | - } |
|
| 90 | -} |
|
@@ -26,65 +26,3 @@ |
||
| 26 | 26 | $this->assertSame([['node' => ['username' => 'user1']]], $result['data']['users']['edges']); |
| 27 | 27 | |
| 28 | 28 | $query = <<<'EOF' |
| 29 | - mutation M { |
|
| 30 | - addUser(input: {username: "user1"}) { |
|
| 31 | - user { |
|
| 32 | - username |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 36 | - EOF; |
|
| 37 | - |
|
| 38 | - $expectedData = [ |
|
| 39 | - 'addUser' => [ |
|
| 40 | - 'user' => ['username' => 'user1'], |
|
| 41 | - ], |
|
| 42 | - ]; |
|
| 43 | - |
|
| 44 | - $this->assertGraphQL($query, $expectedData, null, [], 'public'); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function testInternalSchema(): void |
|
| 48 | - { |
|
| 49 | - $result = $this->executeGraphQLRequest('{bar foo}', [], 'internal'); |
|
| 50 | - $this->assertSame('bar', $result['data']['bar']); |
|
| 51 | - $this->assertSame('foo', $result['data']['foo']); |
|
| 52 | - $this->assertSchemaQueryTypeName('InternalQuery'); |
|
| 53 | - |
|
| 54 | - $result = $this->executeGraphQLRequest('{users{edges{node{username email}}}}', [], 'internal'); |
|
| 55 | - $this->assertSame([['node' => ['username' => 'user1', 'email' => 'topsecret']]], $result['data']['users']['edges']); |
|
| 56 | - |
|
| 57 | - $query = <<<'EOF' |
|
| 58 | - mutation M { |
|
| 59 | - addUser(input: {username: "user1"}) { |
|
| 60 | - user { |
|
| 61 | - username |
|
| 62 | ||
| 63 | - } |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - EOF; |
|
| 67 | - |
|
| 68 | - $expectedData = [ |
|
| 69 | - 'addUser' => [ |
|
| 70 | - 'user' => ['username' => 'user1', 'email' => 'email1'], |
|
| 71 | - ], |
|
| 72 | - ]; |
|
| 73 | - |
|
| 74 | - $this->assertGraphQL($query, $expectedData, null, [], 'internal'); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function testUnknownTypeShouldReturnNull(): void |
|
| 78 | - { |
|
| 79 | - // @phpstan-ignore-next-line |
|
| 80 | - $schema = $this->getContainer()->get('overblog_graphql.request_executor')->getSchema('public'); |
|
| 81 | - $this->assertNull($schema->getType('unknown')); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - private function assertSchemaQueryTypeName(string $typeName): void |
|
| 85 | - { |
|
| 86 | - // @phpstan-ignore-next-line |
|
| 87 | - $query = $this->getContainer()->get('overblog_graphql.type_resolver')->resolve($typeName); |
|
| 88 | - $this->assertSame('Query', $query->name); |
|
| 89 | - } |
|
| 90 | -} |
|
@@ -26,65 +26,3 @@ |
||
| 26 | 26 | $this->assertSame([['node' => ['username' => 'user1']]], $result['data']['users']['edges']); |
| 27 | 27 | |
| 28 | 28 | $query = <<<'EOF' |
| 29 | - mutation M { |
|
| 30 | - addUser(input: {username: "user1"}) { |
|
| 31 | - user { |
|
| 32 | - username |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 36 | - EOF; |
|
| 37 | - |
|
| 38 | - $expectedData = [ |
|
| 39 | - 'addUser' => [ |
|
| 40 | - 'user' => ['username' => 'user1'], |
|
| 41 | - ], |
|
| 42 | - ]; |
|
| 43 | - |
|
| 44 | - $this->assertGraphQL($query, $expectedData, null, [], 'public'); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public function testInternalSchema(): void |
|
| 48 | - { |
|
| 49 | - $result = $this->executeGraphQLRequest('{bar foo}', [], 'internal'); |
|
| 50 | - $this->assertSame('bar', $result['data']['bar']); |
|
| 51 | - $this->assertSame('foo', $result['data']['foo']); |
|
| 52 | - $this->assertSchemaQueryTypeName('InternalQuery'); |
|
| 53 | - |
|
| 54 | - $result = $this->executeGraphQLRequest('{users{edges{node{username email}}}}', [], 'internal'); |
|
| 55 | - $this->assertSame([['node' => ['username' => 'user1', 'email' => 'topsecret']]], $result['data']['users']['edges']); |
|
| 56 | - |
|
| 57 | - $query = <<<'EOF' |
|
| 58 | - mutation M { |
|
| 59 | - addUser(input: {username: "user1"}) { |
|
| 60 | - user { |
|
| 61 | - username |
|
| 62 | ||
| 63 | - } |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - EOF; |
|
| 67 | - |
|
| 68 | - $expectedData = [ |
|
| 69 | - 'addUser' => [ |
|
| 70 | - 'user' => ['username' => 'user1', 'email' => 'email1'], |
|
| 71 | - ], |
|
| 72 | - ]; |
|
| 73 | - |
|
| 74 | - $this->assertGraphQL($query, $expectedData, null, [], 'internal'); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public function testUnknownTypeShouldReturnNull(): void |
|
| 78 | - { |
|
| 79 | - // @phpstan-ignore-next-line |
|
| 80 | - $schema = $this->getContainer()->get('overblog_graphql.request_executor')->getSchema('public'); |
|
| 81 | - $this->assertNull($schema->getType('unknown')); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - private function assertSchemaQueryTypeName(string $typeName): void |
|
| 85 | - { |
|
| 86 | - // @phpstan-ignore-next-line |
|
| 87 | - $query = $this->getContainer()->get('overblog_graphql.type_resolver')->resolve($typeName); |
|
| 88 | - $this->assertSame('Query', $query->name); |
|
| 89 | - } |
|
| 90 | -} |
|