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

Commit

Permalink
Merge remote-tracking branch 'origin/8.x-1.x' into remove-dead-code
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen committed Jul 3, 2020
2 parents 9a31b87 + 0568f68 commit ee6f892
Show file tree
Hide file tree
Showing 62 changed files with 72 additions and 74 deletions.
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
global:
- COMPOSER_MEMORY_LIMIT=2G
matrix:
- TEST_SUITE=8.7.x
- TEST_SUITE=8.8.x
- TEST_SUITE=8.9.x
- TEST_SUITE=9.0.x
Expand All @@ -31,7 +30,6 @@ matrix:
env: TEST_SUITE=PHP_CodeSniffer
allow_failures:
- php: 7.4
- env: TEST_SUITE=9.1.x

mysql:
database: og
Expand Down Expand Up @@ -73,10 +71,6 @@ before_script:
# Install Composer dependencies for core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer install --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 @@ -11,8 +11,8 @@
"source": "https://git.drupalcode.org/project/og"
},
"require": {
"php": ">=7.1.0",
"drupal/core": "~8.7 || ^9.0"
"php": "^7.1.0",
"drupal/core": "^8.8 || ^9.0"
},
"require-dev": {
"drupal/coder": "^8.2"
Expand Down
3 changes: 1 addition & 2 deletions og.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Organic Groups
description: API to allow associating content with groups.
package: Organic Groups

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

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
Expand Up @@ -42,7 +42,7 @@ class BundleFormAlterTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->entityTypeManager = \Drupal::entityTypeManager();
Expand Down
13 changes: 9 additions & 4 deletions src/Plugin/Field/FieldWidget/OgComplex.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,21 @@ protected function otherGroupsWidget(FieldItemListInterface $items, FormStateInt
* A single entity reference input.
*/
public function otherGroupsSingle($delta, EntityInterface $entity = NULL, $weight_delta = 10) {
$selection_settings = [
'other_groups' => TRUE,
'field_mode' => 'admin',
];
if ($this->getFieldSetting('handler_settings')) {
$selection_settings += $this->getFieldSetting('handler_settings');
}

return [
'target_id' => [
// @todo Allow this to be configurable with a widget setting.
'#type' => 'entity_autocomplete',
'#target_type' => $this->fieldDefinition->getFieldStorageDefinition()->getSetting('target_type'),
'#selection_handler' => 'og:default',
'#selection_settings' => [
'other_groups' => TRUE,
'field_mode' => 'admin',
],
'#selection_settings' => $selection_settings,
'#default_value' => $entity,
],
'_weight' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/GroupSubscribeFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class GroupSubscribeFormatterTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Create bundle.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/GroupSubscribeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class GroupSubscribeTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Create bundles.
Expand Down
6 changes: 3 additions & 3 deletions tests/src/Functional/GroupTabTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GroupTabTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Create bundles.
Expand Down Expand Up @@ -99,10 +99,10 @@ protected function setUp() {
public function testGroupTab() {
$this->drupalLogin($this->user1);
$this->drupalGet('group/node/' . $this->group->id() . '/admin');
$this->assertResponse(200);
$this->assertSession()->statusCodeEquals(200);

$this->drupalGet('group/node/' . $this->nonGroup->id() . '/admin');
$this->assertResponse(403);
$this->assertSession()->statusCodeEquals(403);
}

}
2 changes: 1 addition & 1 deletion tests/src/Functional/GroupUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class GroupUpdateTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Create dummy users.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/OgComplexWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OgComplexWidgetTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

// Create a "group" bundle on the Custom Block entity type and turn it into
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Access/AccessByOgMembershipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AccessByOgMembershipTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Access/OgAccessHookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class OgAccessHookTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Access/OgEntityAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class OgEntityAccessTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class OgGroupContentOperationAccessTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Action/ActionTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract class ActionTestBase extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installEntitySchema('og_membership');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChangeMultipleOgMembershipRolesActionTestBase extends ChangeOgMembershipAc
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installSchema('system', ['key_value_expire']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Cache/Context/OgRoleCacheContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class OgRoleCacheContextTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp(): void {
protected function setUp(): void {
parent::setUp();

// Add membership and config schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/DefaultRoleEventIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DefaultRoleEventIntegrationTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->eventDispatcher = $this->container->get('event_dispatcher');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CacheInvalidationOnGroupChangeTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installEntitySchema('entity_test');
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/EntityCreateAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class EntityCreateAccessTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/FieldCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FieldCreateTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Add membership and config schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GetBundleByBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GetBundleByBundleTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GetGroupContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GetGroupContentTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GetMembershipsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GetMembershipsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GetUserGroupsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class GetUserGroupsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GroupAudienceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GroupAudienceTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Add membership and config schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GroupMembershipManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class GroupMembershipManagerTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/GroupTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GroupTypeTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/OgMembershipRoleReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OgMembershipRoleReferenceTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Installing needed schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/OgMembershipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class OgMembershipTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/OgRoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class OgRoleTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Installing needed schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/OgStandardReferenceItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class OgStandardReferenceItemTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Add membership and config schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/ReferenceStringIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ReferenceStringIdTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Add membership and config schema.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Entity/SelectionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SelectionHandlerTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

// Add membership and config schema.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class OgStandardReferenceRelationshipTest extends ViewsKernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp($import_test_views = TRUE) {
protected function setUp($import_test_views = TRUE): void {
parent::setUp();

$this->installEntitySchema('user');
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Form/GroupSubscribeFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GroupSubscribeFormTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->installConfig(['og']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/GroupManagerSubscriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GroupManagerSubscriptionTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->groupTypeManager = $this->container->get('og.group_type_manager');
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/GroupTypeConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GroupTypeConditionTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->conditionManager = $this->container->get('plugin.manager.condition');
Expand Down
Loading

0 comments on commit ee6f892

Please sign in to comment.