Skip to content

Commit 06b3fe6

Browse files
authored
Merge pull request #14 from mcg-web/compatible-with-graphql-v0_10
Make compatible with `webonyx/graphql-php#v0.10`
2 parents ae6e84e + 3694fb4 commit 06b3fe6

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
dist: trusty
2+
13
language: php
24

35
php:
4-
- 5.4
56
- 5.5
67
- 5.6
78
- 7.0
9+
- 7.1
810
- hhvm
911

1012
branches:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"require": {
1818
"php": "^5.4|~7.0",
19-
"webonyx/graphql-php": "*"
19+
"webonyx/graphql-php": "0.10.*"
2020
},
2121
"require-dev": {
2222
"fabpot/php-cs-fixer": "^1.11",

src/Resources/skeleton/ValueConfig.php.skeleton

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
<name> => [
22
<spaces>'name' => <name>,
33
<spaces>'value' => <value>,
44
<spaces>'deprecationReason' => <deprecationReason>,

tests/AbstractStarWarsTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function setUp()
3232

3333
$this->generateClasses();
3434

35-
Config::enableValidation();
35+
@Config::enableValidation();
3636

3737
Resolver::setHumanType($this->getType('Human'));
3838
Resolver::setDroidType($this->getType('Droid'));
@@ -48,8 +48,10 @@ public function setUp()
4848
*/
4949
protected function assertValidQuery($query, $expected, $variables = null)
5050
{
51-
$result = GraphQL::execute($this->schema, $query, null, null, $variables);
51+
$actual = GraphQL::execute($this->schema, $query, null, null, $variables);
52+
$expected = ['data' => $expected];
5253

53-
$this->assertEquals(['data' => $expected], $result, json_encode($result));
54+
//$this->assertSame(array_diff($expected, $actual), array_diff($actual, $expected));
55+
$this->assertEquals($expected, $actual, json_encode($actual));
5456
}
5557
}

tests/StarWarsIntrospectionTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ public function testAllowsQueryingTheSchemaForTypes()
3030
$expected = [
3131
'__schema' => [
3232
'types' => [
33-
['name' => 'Query'],
34-
['name' => 'HeroInput'],
3533
['name' => 'ID'],
36-
['name' => 'Episode'],
37-
['name' => 'Character'],
3834
['name' => 'String'],
39-
['name' => 'Human'],
40-
['name' => 'Droid'],
41-
['name' => 'DateTime'],
35+
['name' => 'Float'],
36+
['name' => 'Int'],
37+
['name' => 'Boolean'],
4238
['name' => '__Schema'],
4339
['name' => '__Type'],
4440
['name' => '__TypeKind'],
45-
['name' => 'Boolean'],
4641
['name' => '__Field'],
4742
['name' => '__InputValue'],
4843
['name' => '__EnumValue'],
4944
['name' => '__Directive'],
5045
['name' => '__DirectiveLocation'],
51-
['name' => 'Float'],
52-
['name' => 'Int'],
46+
['name' => 'Query'],
47+
['name' => 'HeroInput'],
48+
['name' => 'Episode'],
49+
['name' => 'Character'],
50+
['name' => 'Human'],
51+
['name' => 'Droid'],
52+
['name' => 'DateTime'],
5353
]
5454
]
5555
];

0 commit comments

Comments
 (0)