Skip to content

Commit

Permalink
add coverage of Drupal 11.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Feb 21, 2024
1 parent d669937 commit 39e6433
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 20 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ jobs:

strategy:
matrix:
drupal_version: ['9.5', '10.0', '10.1', '10.2']
drupal_version: ['9.5', '10.0', '10.1', '10.2', '11.0']
module: ['template_whisperer']
experimental: [ false ]
include:
- drupal_version: '11.0'
module: 'bamboo_twig'
experimental: true

steps:
- uses: actions/checkout@v3
Expand All @@ -39,9 +43,13 @@ jobs:

strategy:
matrix:
drupal_version: ['9.5', '10.0', '10.1', '10.2']
drupal_version: ['9.5', '10.0', '10.1', '10.2', '11.0']
module: ['template_whisperer']
experimental: [ false ]
include:
- drupal_version: '11.0'
module: 'bamboo_twig'
experimental: true

steps:
- uses: actions/checkout@v3
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v1
- uses: actions/checkout@v3
tools: cs2pr, composer:v2
- uses: actions/checkout@v4
- run: composer install --prefer-dist
- run: ./vendor/bin/phpcs ./ --report=checkstyle | cs2pr

Expand All @@ -23,10 +23,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v1, phpmd
- uses: actions/checkout@v3
tools: cs2pr, composer:v2, phpmd
- uses: actions/checkout@v4
- run: composer install --prefer-dist
- run: phpmd ./ text ./phpmd.xml --suffixes php,module,inc,install,test,profile,theme,css,info,txt --exclude *Test.php,*vendor/*

Expand All @@ -37,18 +37,18 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v1, phpcpd
- uses: actions/checkout@v3
tools: cs2pr, composer:v2, phpcpd
- uses: actions/checkout@v4
- run: composer install --prefer-dist
- run: phpcpd ./src --suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test --suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt --exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/

phpdd:
name: PhpDeprecationDetector (phpdd)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: docker-compose -f docker-compose.yml pull --include-deps drupal
- name: Build the docker-compose stack
run: docker-compose -f docker-compose.yml build drupal
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- add call accessCheck on every QueryBuilder
- add Drupal GitlabCI
- add coverage of Drupal 10.2.x
- add coverage of Drupal 11.0-dev

### Removed
- drop tests support on Drupal < 9.4
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ First of all, you need to have the following tools installed globally
on your environment:

* drush
* Latest dev release of Drupal 8.x/9.x/10.x.
* Latest dev release of Drupal 8.x/9.x/10.x/11.x.
* docker
* docker-compose

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ but those are some of the obvious uses of Template Whisperer.

## Which version should I use?

Template Whisperer is available for Drupal 8, Drupal 9 and Drupal 10!
Template Whisperer is available for Drupal 8, Drupal 9, Drupal 10 and Drupal 11 (dev)!

| Drupal Core | Template Whisperer |
|:-----------:|:------------------:|
Expand All @@ -77,6 +77,7 @@ Template Whisperer is available for Drupal 8, Drupal 9 and Drupal 10!
| 8.9.x | 3.0 |
| 9.x | 3.x |
| 10.x | 4.0.x |
| 11.x-dev | 4.0.x |

## Dependencies

Expand Down
2 changes: 1 addition & 1 deletion template_whisperer.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Template Whisperer
type: module
description: Provides a formalized way to declare and suggest page templates.
core_version_requirement: ^9.3 || ^10
core_version_requirement: ^9.3 || ^10 || ^11
package: Fields types

dependencies:
Expand Down
9 changes: 8 additions & 1 deletion tests/src/Functional/UiFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public function testAddField() {
else {
$this->clickLink('Add field');
}
$this->assertSession()->addressEquals('admin/structure/types/manage/article/fields/add-field');

// Add the Template Whisperer field.
// Since Drupal 10.2 the field type has been changed from select to radio.
Expand All @@ -115,7 +116,13 @@ public function testAddField() {
$this->fillField('Add a new field', 'template_whisperer');
}

$this->fillField('Label', 'Template Whisperer');
// Since Drupal 11.0 The field name and machine name must be done in another page.

Check warning on line 119 in tests/src/Functional/UiFieldTest.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 80 characters; contains 86 characters
if (version_compare(\Drupal::VERSION, '11', '>=')) {
$this->pressButton('Continue');
$this->assertSession()->addressEquals('admin/structure/types/manage/article/fields/add-field');
}

$this->fillField('label', 'Template Whisperer');
$this->fillField('Machine-readable name', 'template_whisperer');

// Since Drupal 10.2 the submit button text changed.
Expand Down
14 changes: 10 additions & 4 deletions tests/src/Functional/WidgetFormElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,16 @@ public function testWhenNotPossibleStayInPlace() {
// Access the taxonomy term edit page.
$this->drupalGet('taxonomy/term/' . $this->tag->id() . '/edit');

$this->assertSession()->elementNotExists('css', 'div[data-vertical-tabs-panes]');

// Asserts the field is located at the end of the form.
$this->assertSession()->elementExists('css', '#edit-field-template-whisperer-2-0');
// Since Drupal 11.0 Taxonomy term form has been changed to support tabs.
if (version_compare(\Drupal::VERSION, '11', '>=')) {
// Asserts the field is located on the Advanced Group - when possible.
$this->assertSession()->elementExists('css', 'div[data-vertical-tabs-panes] #edit-field-template-whisperer-2-0 select');
}
else {
// Asserts the field is located at the end of the form.
$this->assertSession()->elementNotExists('css', 'div[data-vertical-tabs-panes]');
$this->assertSession()->elementExists('css', '#edit-field-template-whisperer-2-0');
}
}

}

0 comments on commit 39e6433

Please sign in to comment.