Skip to content

Commit 828efec

Browse files
stephen-coxekes
andauthored
Drupal 11 support (#115)
* Drupal 11 support * Add Drupal 11 support for test modules * Add Drupal 11 support for test modules * Require Webform ^6.2 || ^6.3@beta * Fix failing tests * Fix failing tests * Testing suggestion by @Adnan-cds d8c64bb#r2071719954 Underlying issue https://www.drupal.org/project/drupal/issues/2245905 * Fix seems to work. Correcting PHP CS. --------- Co-authored-by: ekes <[email protected]>
1 parent c3d7b38 commit 828efec

File tree

9 files changed

+27
-11
lines changed

9 files changed

+27
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "GPL-2.0-or-later",
77
"minimum-stability": "dev",
88
"require": {
9-
"drupal/webform": "^6.0",
9+
"drupal/webform": "^6.2 || ^6.3@beta",
1010
"drupal/geocoder": "^3.44 || ^4.21",
1111
"localgovdrupal/localgov_os_places_geocoder_provider": "1.x-dev"
1212
},

localgov_forms.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: LocalGov Forms
22
type: module
33
description: Provides additional configuration, styling and components for the Drupal Webform module.
4-
core_version_requirement: ^8.8 || ^9 || ^10
4+
core_version_requirement: ^10 || ^11
55
package: LocalGov Drupal
66

77
dependencies:

modules/localgov_forms_date/localgov_forms_date.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'LocalGov Forms: Date'
22
type: module
33
description: 'A custom Date component'
44
package: LocalGov Drupal
5-
core_version_requirement: ^8 || ^9 || ^10
5+
core_version_requirement: ^10 || ^11
66
dependencies:
77
- 'webform:webform'
88
- 'localgov_forms:localgov_forms'

modules/localgov_forms_date/tests/modules/localgov_forms_date_test/localgov_forms_date_test.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Localgov form date test'
22
description: 'Helper module to setup a webform with a localgov_forms_date field.'
33
type: module
44
package: Testing
5-
core_version_requirement: ^8.8 || ^9 || ^10
5+
core_version_requirement: ^10 || ^11
66

77
dependencies:
88
- webform:webform

modules/localgov_forms_date/tests/src/Kernel/DateWebformElementTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ protected function passCase(): void {
3434
$form_state->setValue('date',
3535
['day' => '1', 'month' => '1', 'year' => '1']);
3636
$form_state->setValue('op', 'Submission');
37+
$form_state->setValue('submit', 'Submit');
3738

38-
$this->container->get('form_builder')->submitForm(clone($this->testForm), $form_state);
39+
$test_form = clone($this->testForm);
40+
$this->container->get('form_builder')->submitForm($test_form, $form_state);
3941
$this->assertEmpty($form_state->getErrors());
4042
}
4143

@@ -89,12 +91,10 @@ protected function setUp(): void {
8991

9092
$this->installEntitySchema('user');
9193
$this->installEntitySchema('path_alias');
92-
9394
$this->installSchema('webform', ['webform']);
94-
9595
$this->installConfig('system');
96+
$this->installConfig('webform');
9697
$this->installConfig('localgov_forms_date_test');
97-
9898
$this->installConfig('localgov_forms_date');
9999

100100
$empty_submission = WebformSubmission::create(['webform_id' => 'date_test']);

modules/localgov_forms_decision_tree/localgov_forms_decision_tree.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: LocalGov Forms Demo Decision Tree
22
type: module
33
description: Demo of creating a decision tree with Drupal&#039;s webform module.
44
package: LocalGov Drupal Examples
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^10 || ^11
66
dependencies:
77
- 'webform:webform'

modules/localgov_forms_example_liberty_create_integration/localgov_forms_example_liberty_create_integration.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: LocalGov Forms example Liberty Create integration
22
type: module
33
description: Liberty Create API integration example.
4-
core_version_requirement: ^10
4+
core_version_requirement: ^10 || ^11
55
package: LocalGov Drupal
66

77
dependencies:

tests/modules/localgov_forms_test/localgov_forms_test.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Localgov form test'
22
description: 'Helper module to setup a Contact webform.'
33
type: module
44
package: Testing
5-
core_version_requirement: ^8.8 || ^9 || ^10
5+
core_version_requirement: ^10 || ^11
66

77
dependencies:
88
- webform:webform

tests/modules/localgov_forms_test/src/Driver/Database/FakeLts/Connection.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Drupal\localgov_forms_test\Driver\Database\FakeLts;
66

7+
use Drupal\Core\Database\Transaction\TransactionManagerInterface;
8+
use Drupal\mysql\Driver\Database\mysql\TransactionManager;
79
use Drupal\Tests\Core\Database\Stub\StubConnection;
810
use Drupal\Tests\Core\Database\Stub\StubPDO;
911

@@ -29,4 +31,18 @@ public static function open(array &$connection_options = []) {
2931
return new StubPDO();
3032
}
3133

34+
/**
35+
* {@inheritdoc}
36+
*/
37+
protected function driverTransactionManager(): TransactionManagerInterface {
38+
return new TransactionManager($this);
39+
}
40+
41+
/**
42+
* {@inheritdoc}
43+
*
44+
* Work-around for avoiding TransactionManager usage.
45+
*/
46+
public function commitAll(): void {}
47+
3248
}

0 commit comments

Comments
 (0)