Skip to content

Commit abd440a

Browse files
committed
Merge branch '0.11'
2 parents 57a8094 + bbd2b7e commit abd440a

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

src/Resolver/ResolverMap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class ResolverMap implements ResolverMapInterface
1818
/**
1919
* Resolvers map.
2020
*
21-
* @return callable[]
21+
* @return array<string, callable[]>
2222
*/
2323
abstract protected function map();
2424

tests/Functional/Upload/UploadTest.php

+28-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use GraphQL\Error\InvariantViolation;
88
use Overblog\GraphQLBundle\Tests\Functional\TestCase;
9+
use Overblog\GraphQLBundle\Tests\VersionHelper;
910
use Symfony\Component\HttpFoundation\File\UploadedFile;
1011

1112
class UploadTest extends TestCase
@@ -111,9 +112,12 @@ public function testSerializationIsUnsupported(): void
111112

112113
public function testParseLiteralIsUnsupported(): void
113114
{
114-
$this->expectException(InvariantViolation::class);
115-
$this->expectExceptionMessage('Upload scalar literal unsupported.');
116-
$this->uploadRequest(
115+
$willThrowRawException = VersionHelper::compareWebonyxGraphQLPHPVersion('0.13.1', '<');
116+
if ($willThrowRawException) {
117+
$this->expectException(InvariantViolation::class);
118+
$this->expectExceptionMessage('Upload scalar literal unsupported.');
119+
}
120+
$result = $this->uploadRequest(
117121
[
118122
'operations' => [
119123
'query' => 'mutation { singleUpload(file: {}) }',
@@ -123,6 +127,27 @@ public function testParseLiteralIsUnsupported(): void
123127
],
124128
['0' => 'a.txt']
125129
);
130+
if (!$willThrowRawException) {
131+
$this->assertEquals(
132+
[
133+
'errors' => [
134+
[
135+
'message' => 'Field "singleUpload" argument "file" requires type Upload, found {}; GraphQLUpload scalar literal unsupported.',
136+
'extensions' => [
137+
'category' => 'graphql',
138+
],
139+
'locations' => [
140+
[
141+
'line' => 1,
142+
'column' => 31,
143+
],
144+
],
145+
],
146+
],
147+
],
148+
$result
149+
);
150+
}
126151
}
127152

128153
private function assertUpload(array $expected, array $parameters, array $files, $uri = '/', $json = true): void

0 commit comments

Comments
 (0)