Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

#3129354 Add Drupal 9 support #640

Merged
merged 17 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,23 @@ env:
- TEST_SUITE=8.8.x
- TEST_SUITE=8.9.x
- TEST_SUITE=9.0.x
- TEST_SUITE=9.1.x
- TEST_SUITE=PHP_CodeSniffer

# Only run the coding standards check once.
matrix:
exclude:
- php: 7.2
env: TEST_SUITE=9.0.x
- php: 7.2
env: TEST_SUITE=9.1.x
- php: 7.2
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.4
env: TEST_SUITE=PHP_CodeSniffer
allow_failures:
- php: 7.4
- env: TEST_SUITE=9.0.x
- env: TEST_SUITE=9.1.x

mysql:
database: og
Expand All @@ -38,6 +41,10 @@ mysql:
services:
- mysql

cache:
directories:
- $HOME/.composer/cache/files

before_script:
# Remove Xdebug as we don't need it and it causes "PHP Fatal error: Maximum
# function nesting level of '256' reached."
Expand All @@ -63,15 +70,12 @@ before_script:
# Remember the Drupal installation path.
- DRUPAL_DIR=$(pwd)/drupal

# Download Drupal console so we can run the test for it. Skip this for the
# coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer require --dev drupal/console:~1.0 --working-dir=$DRUPAL_DIR

# Install Composer dependencies for core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer install --working-dir=$DRUPAL_DIR

# PHPUnit 6 is required when running tests on PHP 7.x.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || test ${TRAVIS_PHP_VERSION:0:3} == "5.6" || composer require --dev phpunit/phpunit:~6 --update-with-dependencies --working-dir=$DRUPAL_DIR
# Drupal 8.7.x still uses the legacy PHPUnit 4.x which is not compatible with
# PHP 7. Update it to 6.x.
- test ${TEST_SUITE} == "8.7.x" && composer require --dev phpunit/phpunit:~6 --update-with-dependencies --working-dir=$DRUPAL_DIR || true

# Start a web server on port 8888 in the background.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || nohup php -S localhost:8888 --docroot $DRUPAL_DIR > /dev/null 2>&1 &
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
},
"require": {
"php": ">=7.1.0",
"drupal/core": "~8.7"
"drupal/core": "~8.7 || ^9.0"
},
"require-dev": {
"drupal/coder": "~8.2"
"drupal/coder": "^8.2"
},
"minimum-stability": "RC"
}
1 change: 1 addition & 0 deletions og.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: API to allow associating content with groups.
package: Organic Groups

core: 8.x
core_version_requirement: ^8 || ^9
type: module
php: 7.1

Expand Down
1 change: 1 addition & 0 deletions og_ui/og_ui.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package: Organic Groups

type: module
core: 8.x
core_version_requirement: ^8 || ^9

dependencies:
- og
Expand Down
2 changes: 1 addition & 1 deletion og_ui/tests/src/Functional/BundleFormAlterTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Drupal\og_ui\Tests;
namespace Drupal\Tests\og_ui\Functional;

use Drupal\Core\Form\FormState;
use Drupal\node\Entity\NodeType;
Expand Down
178 changes: 0 additions & 178 deletions src/Command/OgAddFieldCommand.php

This file was deleted.

3 changes: 2 additions & 1 deletion src/Controller/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Drupal\og\OgMembershipInterface;
use Drupal\og\OgMembershipTypeInterface;
use Drupal\user\EntityOwnerInterface;
use Drupal\user\UserInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
Expand Down Expand Up @@ -91,7 +92,7 @@ public function subscribe($entity_type_id, EntityInterface $group, OgMembershipT

$user_login_url = Url::fromRoute('user.login', [], $destination)->toString();

if ($this->config('user.settings')->get('register') === USER_REGISTER_ADMINISTRATORS_ONLY) {
if ($this->config('user.settings')->get('register') === UserInterface::REGISTER_ADMINISTRATORS_ONLY) {
$params = [':login' => $user_login_url];
$this->messenger->addMessage($this->t('In order to join any group, you must <a href=":login">login</a>. After you have successfully done so, you will need to request membership again.', $params));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ type: module
description: 'Provides default views for views OG standard reference tests.'
package: Testing
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- drupal:views
1 change: 1 addition & 0 deletions tests/modules/og_test/og_test.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ type: module
description: 'Support module for Organic Groups testing.'
package: Testing
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- drupal:options
3 changes: 2 additions & 1 deletion tests/src/Functional/GroupSubscribeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\node\NodeInterface;
use Drupal\og\Entity\OgMembershipType;
use Drupal\og\Entity\OgRole;
use Drupal\og\Og;
Expand Down Expand Up @@ -137,7 +138,7 @@ protected function setUp() {
'type' => $this->groupBundle1,
'title' => $this->randomString(),
'uid' => $user->id(),
'status' => NODE_NOT_PUBLISHED,
'status' => NodeInterface::NOT_PUBLISHED,
]);
$this->group3->save();

Expand Down
Loading