Skip to content

Commit 8418bb7

Browse files
Leksathugovkdamienmckenna
authored
Drupal 9 compatibility for 3.x (#1102)
* Update core_version_requirement for Drupal 8.8+ and 9+ 'core: 8.x' not needed for 8.8+ 'core_version_requirement' not needed for test modules https://www.drupal.org/node/3070687 Co-authored-by: Damien McKenna <damien@mc-kenna.com> * Test D9.0 on Travis CI * Replace deprecated drupal_set_message() with messenger->addMessage() Co-authored-by: Damien McKenna <damien@mc-kenna.com> * Replace deprecated file_directory_temp() with getTempDirectory() Co-authored-by: Damien McKenna <damien@mc-kenna.com> * Replace deprecated PHPUnit_Framework_MockObject_MockObject with PHPUnit\Framework\MockObject\MockObject Co-authored-by: Damien McKenna <damien@mc-kenna.com> * Replace deprecated RouteEnhancerInterface with EnhancerInterface Co-authored-by: Damien McKenna <damien@mc-kenna.com> * Remove deprecated PHPUnit_Framework_Error_Warning * Replace 'core: 8.x' with 'core_version_requirement: ^8.8 || ^9' * Replace deprecated entity.manager with entity_type.manager * Must enable the path_alias module in tests * Replace deprecated url() with createFileUrl(FALSE) * Assert menu is an object, rather than assert it is true * chore: adjust things mentioned in #1067 * chore: adjust info.yml files for test modules * chore: trigger travis build * chore: keep composer at version 1 Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Damien McKenna <damien@mc-kenna.com>
1 parent 94cbcd4 commit 8418bb7

21 files changed

Lines changed: 69 additions & 55 deletions

File tree

.travis.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ env:
1616
- SIMPLETEST_DB=mysql://root:@127.0.0.1/graphql
1717
- TRAVIS=true
1818
matrix:
19-
- DRUPAL_CORE=8.8.x
19+
- DRUPAL_CORE=9.0.x
2020
- DRUPAL_CORE=8.9.x
21+
- DRUPAL_CORE=8.8.x
2122

2223
matrix:
2324
# Don't wait for the allowed failures to build.
@@ -28,6 +29,17 @@ matrix:
2829
- DRUPAL_CORE=8.8.x
2930
# Only run code coverage on the latest php and drupal versions.
3031
- WITH_PHPDBG_COVERAGE=true
32+
# Drupal 9 requires PHP 7.3 or higher
33+
exclude:
34+
- php: 7.0
35+
env:
36+
- DRUPAL_CORE=9.0.x
37+
- php: 7.1
38+
env:
39+
- DRUPAL_CORE=9.0.x
40+
- php: 7.2
41+
env:
42+
- DRUPAL_CORE=9.0.x
3143
allow_failures:
3244
# Allow the code coverage report to fail.
3345
- php: 7.3
@@ -62,8 +74,9 @@ before_install:
6274
# Disable the default memory limit.
6375
- echo memory_limit = -1 >> $PHPINI
6476

65-
# Update composer.
66-
- composer self-update
77+
# Update composer. But keep it at version 1 for compatibility with older
78+
# Drupal versions.
79+
- composer self-update --1
6780

6881
install:
6982
# Create the database.

graphql.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ type: module
33
description: 'Base module for integrating GraphQL with Drupal.'
44
package: GraphQL
55
configure: graphql.config_page
6-
core: 8.x
6+
core_version_requirement: ^8.8 || ^9

modules/graphql_core/graphql_core.info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: GraphQL Core
22
type: module
33
description: 'Provides type system plugins and derivers on behalf of core modules.'
44
package: GraphQL
5-
core: 8.x
5+
core_version_requirement: ^8.8 || ^9
66
dependencies:
7-
- graphql
7+
- graphql:graphql
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: 'GraphQL Test: Blocks'
22
type: module
3-
core: 8.x
3+
package: Testing
4+
core_version_requirement: ^8.8 || ^9
5+
hidden: TRUE
46
dependencies:
5-
- block
6-
- block_content
7-
- ckeditor
8-
- editor
9-
- field
10-
- filter
11-
- system
12-
- text
7+
- drupal:block
8+
- drupal:block_content
9+
- drupal:ckeditor
10+
- drupal:editor
11+
- drupal:field
12+
- drupal:filter
13+
- drupal:system
14+
- drupal:text
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: GraphQL Breadcrumbs test
22
type: module
33
description: 'Test for breadcrumbs.'
4-
package: GraphQL
5-
core: 8.x
4+
package: Testing
5+
core_version_requirement: ^8.8 || ^9
6+
hidden: TRUE
67
dependencies:
7-
- graphql_breadcrumbs
8+
- graphql:graphql_core

modules/graphql_core/tests/modules/graphql_context_test/graphql_context_test.info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Context Test
33
description: Test contexts in graphql schema.
44
package: Testing
5-
core: 8.x
5+
core_version_requirement: ^8.8 || ^9
66
hidden: TRUE
77
dependencies:
8-
- graphql_core
8+
- graphql:graphql_core

modules/graphql_core/tests/modules/graphql_requests_test/graphql_requests_test.info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: module
22
name: GraphQL Requests Test
33
description: Dummy callbacks for internal request testing.
44
package: Testing
5-
core: 8.x
5+
core_version_requirement: ^8.8 || ^9
66
hidden: TRUE
77
dependencies:
8-
- graphql_core
8+
- graphql:graphql_core
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: 'GraphQL Tests: Menu'
22
type: module
3-
core: 8.x
3+
package: Testing
4+
core_version_requirement: ^8.8 || ^9
5+
hidden: TRUE
46
dependencies:
5-
- system
7+
- drupal:system

modules/graphql_core/tests/src/Kernel/Entity/EntityByIdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function setUp() {
3232
parent::setUp();
3333

3434
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $languageStorage */
35-
$languageStorage = $this->container->get('entity.manager')->getStorage('configurable_language');
35+
$languageStorage = $this->container->get('entity_type.manager')->getStorage('configurable_language');
3636

3737
$language = $languageStorage->create([
3838
'id' => $this->chineseSimplifiedLangcode,

modules/graphql_core/tests/src/Kernel/GraphQLCoreTestBase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class GraphQLCoreTestBase extends GraphQLTestBase {
1414
*/
1515
public static $modules = [
1616
'graphql_core',
17+
'path_alias',
1718
'user',
1819
];
1920

0 commit comments

Comments
 (0)