Skip to content

Commit a78f8fd

Browse files
authored
Update in alignment with GraphQL 3.0 (#32)
1 parent 289d0b7 commit a78f8fd

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

.travis.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ language: php
22
sudo: false
33

44
php:
5+
- 7.3
6+
- 7.2
57
- 7.1
6-
- 7
7-
- 5.6
8+
- 7.0
9+
10+
services:
11+
- mysql
812

913
env:
1014
global:
@@ -13,24 +17,23 @@ env:
1317
- SIMPLETEST_DB=mysql://root:@127.0.0.1/graphql
1418
- TRAVIS=true
1519
matrix:
16-
- DRUPAL_CORE=8.4.x
17-
- DRUPAL_CORE=8.5.x
18-
- DRUPAL_CORE=8.6.x
20+
- DRUPAL_CORE=8.7.x
21+
- DRUPAL_CORE=8.8.x
1922

2023
matrix:
2124
# Don't wait for the allowed failures to build.
2225
fast_finish: true
2326
include:
24-
- php: 7.1
27+
- php: 7.3
2528
env:
26-
- DRUPAL_CORE=8.6.x
29+
- DRUPAL_CORE=8.7.x
2730
# Only run code coverage on the latest php and drupal versions.
2831
- WITH_PHPDBG_COVERAGE=true
2932
allow_failures:
3033
# Allow the code coverage report to fail.
31-
- php: 7.1
34+
- php: 7.3
3235
env:
33-
- DRUPAL_CORE=8.6.x
36+
- DRUPAL_CORE=8.7.x
3437
# Only run code coverage on the latest php and drupal versions.
3538
- WITH_PHPDBG_COVERAGE=true
3639

@@ -54,14 +57,6 @@ before_install:
5457
else export PHPINI=$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini;
5558
fi
5659

57-
# PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated
58-
# and will be removed in a future version. To avoid this warning set
59-
# 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input
60-
# stream instead.
61-
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]];
62-
then echo always_populate_raw_post_data = -1 >> $PHPINI;
63-
fi;
64-
6560
# Disable the default memory limit.
6661
- echo memory_limit = -1 >> $PHPINI
6762

@@ -92,10 +87,17 @@ install:
9287

9388
# Bring in the module dependencies without requiring a merge plugin. The
9489
# require also triggers a full 'composer install'.
95-
- composer --working-dir=$DRUPAL_BUILD_DIR require webonyx/graphql-php:^0.12.6
90+
- composer --working-dir=$DRUPAL_BUILD_DIR require webonyx/graphql-php:^0.12.5
91+
92+
# For Drupal < 8.8 we have to manually upgrade zend-stdlib to avoid PHP 7.3
93+
# incompatibilities.
94+
- if [[ "$DRUPAL_CORE" = "8.6.x" || "$DRUPAL_CORE" = "8.7.x" ]];
95+
then composer --working-dir=$DRUPAL_BUILD_DIR require zendframework/zend-stdlib:3.2.1;
96+
fi
9697

97-
# Update PHPUnit for Drupal version >= 8.5.0
98-
- if [[ "$DRUPAL_CORE" != "8.4.x" ]];
98+
# For Drupal < 8.8 we have to manually upgrade phpunit to avoid PHP 7.3
99+
# incompatibilities.
100+
- if [[ "$DRUPAL_CORE" = "8.6.x" || "$DRUPAL_CORE" = "8.7.x" ]];
99101
then composer --working-dir=$DRUPAL_BUILD_DIR run-script drupal-phpunit-upgrade;
100102
fi
101103

tests/src/Kernel/ViewsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testSimpleView() {
4343
'node:2',
4444
'node:3',
4545
'node_list',
46-
]));
46+
])->addCacheContexts(['user']));
4747
}
4848

4949
/**
@@ -90,7 +90,7 @@ public function testPagedView() {
9090
'node:8',
9191
'node:9',
9292
'node_list',
93-
]));
93+
])->addCacheContexts(['user']));
9494
}
9595

9696
/**
@@ -145,7 +145,7 @@ public function testSortedView() {
145145
'node:8',
146146
'node:9',
147147
'node_list',
148-
]));
148+
])->addCacheContexts(['user']));
149149
}
150150

151151
/**
@@ -177,7 +177,7 @@ public function testFilteredView() {
177177
'node:4',
178178
'node:7',
179179
'node_list',
180-
]));
180+
])->addCacheContexts(['user']));
181181
}
182182

183183
/**
@@ -214,7 +214,7 @@ public function testMultiValueFilteredView() {
214214
'node:8',
215215
'node_list',
216216

217-
]));
217+
])->addCacheContexts(['user']));
218218
}
219219

220220
/**
@@ -256,7 +256,7 @@ public function testComplexFilteredView() {
256256
'node:8',
257257
'node:9',
258258
'node_list',
259-
]));
259+
])->addCacheContexts(['user']));
260260
}
261261

262262
/**

tests/src/Kernel/ViewsTestBase.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
namespace Drupal\Tests\graphql_views\Kernel;
44

5-
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
6-
use Drupal\simpletest\ContentTypeCreationTrait;
7-
use Drupal\simpletest\NodeCreationTrait;
85
use Drupal\taxonomy\Entity\Term;
96
use Drupal\taxonomy\Entity\Vocabulary;
10-
use Drupal\user\Entity\Role;
7+
use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
118
use Drupal\Tests\graphql_core\Kernel\GraphQLContentTestBase;
12-
use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
9+
use Drupal\Tests\node\Traits\ContentTypeCreationTrait;
10+
use Drupal\Tests\node\Traits\NodeCreationTrait;
1311

1412
/**
1513
* Base class for test views support in GraphQL.
@@ -20,7 +18,6 @@ abstract class ViewsTestBase extends GraphQLContentTestBase {
2018
use NodeCreationTrait;
2119
use ContentTypeCreationTrait;
2220
use EntityReferenceTestTrait;
23-
use TaxonomyTestTrait;
2421

2522
/**
2623
* {@inheritdoc}

0 commit comments

Comments
 (0)