Skip to content
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
1 change: 1 addition & 0 deletions .cspell-project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ msword
officedocument
openxmlformats
wordprocessingml
datetimeplus
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

strategy:
matrix:
drupal_version: ['10.0', '10.1', '10.2', '10.3', '10.4', '11.0', '11.1']
drupal_version: ['10.5', '11.0', '11.1', '11.2']
module: ['bamboo_twig']
experimental: [false]
include:
- drupal_version: '11.2'
- drupal_version: '11.3'
module: 'bamboo_twig'
experimental: true

Expand All @@ -41,11 +41,11 @@ jobs:

strategy:
matrix:
drupal_version: ['10.0', '10.1', '10.2', '10.3', '10.4', '11.0', '11.1']
drupal_version: ['10.5', '11.0', '11.1', '11.2']
module: ['bamboo_twig']
experimental: [false]
include:
- drupal_version: '11.2'
- drupal_version: '11.3'
module: 'bamboo_twig'
experimental: true

Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

strategy:
matrix:
drupal_version: ['10.4']
drupal_version: ['10.5']
module: ['bamboo_twig']

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v2
- uses: actions/checkout@v5
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v2, phpmd
- uses: actions/checkout@v5
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: cs2pr, composer:v2, phpcpd
- uses: actions/checkout@v5
Expand Down
7 changes: 4 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ variables:
SKIP_ESLINT: '1'
# Opt in to testing current minor against max supported PHP version.
OPT_IN_TEST_MAX_PHP: '1'
# Opt in to testing previous minor (Drupal 11.0.13) & next minor (Drupal 11.2-dev).
# Opt in to testing previous minor (Drupal 11.1.x)
OPT_IN_TEST_PREVIOUS_MINOR: '1'
# Opt in to testing next minor (Drupal 11.3.x).
OPT_IN_TEST_NEXT_MINOR: '1'
# Opt in to testing $CORE_PREVIOUS_MAJOR (currently Drupal 10.4.6).
# Opt in to testing $CORE_PREVIOUS_MAJOR (Drupal 10.4.x).
OPT_IN_TEST_PREVIOUS_MAJOR: '1'
# Opt in to testing $CORE_MAJOR_DEVELOPMENT (currently Drupal 12).
# Opt in to testing $CORE_MAJOR_DEVELOPMENT (Drupal 12).
OPT_IN_TEST_NEXT_MAJOR: '1'

# This module wants to strictly comply with Drupal's coding standards.
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- ignore phpstan Call to internal function twig_date_converter - already adressed

### Added
- add official support of drupal 10.5
- add official support of drupal 11.2
- add 'datetimeplus' to cspell ignore wordlist

### Removed
- drop coverage of Drupal 10.0.x
- drop coverage of Drupal 10.1.x
- drop coverage of Drupal 10.2.x
- drop coverage of Drupal 10.3.x
- drop coverage of Drupal 10.4.x
- remove legacy 'version_compare' from Tests suites

## [6.0.4] - 2025-05-15
### Removed
- drop support of Drupal 9.x
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ globally on your environment:

Once run, you will be able to access to your fresh installed Drupal on `localhost::8888`.

docker compose build --pull --build-arg BASE_IMAGE_TAG=10.4 drupal
docker compose build --pull --build-arg BASE_IMAGE_TAG=11.2 drupal
(get a coffee, this will take some time...)
docker compose up -d drupal
docker compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE_TAG=10.1
ARG BASE_IMAGE_TAG=11.2
FROM wengerk/drupal-for-contrib:${BASE_IMAGE_TAG}

ARG BASE_IMAGE_TAG
Expand Down
2 changes: 1 addition & 1 deletion bamboo_twig.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Bamboo Twig
description: 'Several Twig extensions with some useful functions and filters that can improve development experience.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11
2 changes: 1 addition & 1 deletion bamboo_twig_cacheable/bamboo_twig_cacheable.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Cacheable
description: 'Several "Cacheable" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_config/bamboo_twig_config.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Config
description: 'Several "Config" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_extensions/bamboo_twig_extensions.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Extensions
description: 'Twig extensions (Text, Date & Array) from http://twig-extensions.readthedocs.io/en/latest/index.html.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_file/bamboo_twig_file.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - File
description: 'Several "File" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_i18n/bamboo_twig_i18n.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Internationalization
description: 'Several "i18n" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_loader/bamboo_twig_loader.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Loaders
description: 'Several "Loaders & Render" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_path/bamboo_twig_path.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Path & Url
description: 'Several "Path & Url" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_security/bamboo_twig_security.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Security
description: 'Several "Security" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion bamboo_twig_token/bamboo_twig_token.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig - Token
description: 'Several "Token" Twig extensions.'
package: Bamboo Twig
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- bamboo_twig:bamboo_twig
2 changes: 1 addition & 1 deletion tests/modules/bamboo_twig_test/bamboo_twig_test.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Bamboo Twig test
description: Support module for Bamboo Twig testing.
package: Testing
type: module
core_version_requirement: ^10 || ^11
core_version_requirement: ^10.5 || ^11

dependencies:
- drupal:bamboo_twig
26 changes: 2 additions & 24 deletions tests/src/Functional/BambooTwigRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,33 +455,11 @@ public function testMenu() {
$this->drupalGet('/bamboo-twig-render');
$this->assertSession()->elementExists('css', '.test-render div.render-menu-all');
$this->assertElementCount('ul', 9, '.test-render div.render-menu-all');

// Since Drupal 10.2.x the default Drupal distribution have X menu items.
if (version_compare(\Drupal::VERSION, '10.2', '>=')) {
$this->assertElementCount('li', 24, '.test-render div.render-menu-all');
}
// Since Drupal 10.1.x the default Drupal distribution have X menu items.
elseif (version_compare(\Drupal::VERSION, '10.1', '>=')) {
$this->assertElementCount('li', 29, '.test-render div.render-menu-all');
}
else {
$this->assertElementCount('li', 27, '.test-render div.render-menu-all');
}
$this->assertElementCount('li', 24, '.test-render div.render-menu-all');

$this->assertSession()->elementExists('css', '.test-render div.render-menu-level');
$this->assertElementCount('ul', 8, '.test-render div.render-menu-level');

// Since Drupal 10.2.x the default Drupal distribution have X menu items.
if (version_compare(\Drupal::VERSION, '10.2', '>=')) {
$this->assertElementCount('li', 23, '.test-render div.render-menu-level');
}
// Since Drupal 10.1.x the default Drupal distribution have X menu items.
elseif (version_compare(\Drupal::VERSION, '10.1', '>=')) {
$this->assertElementCount('li', 28, '.test-render div.render-menu-level');
}
else {
$this->assertElementCount('li', 26, '.test-render div.render-menu-level');
}
$this->assertElementCount('li', 23, '.test-render div.render-menu-level');

$this->assertSession()->elementExists('css', '.test-render div.render-menu-depth');
$this->assertElementCount('ul', 2, '.test-render div.render-menu-depth');
Expand Down
6 changes: 0 additions & 6 deletions tests/src/Kernel/BambooTwigSecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ protected function setUp(): void {

$this->installEntitySchema('user');

// Since Drupal 10.2.0 installing the table sequences with the
// method KernelTestBase::installSchema() is deprecated.
if (version_compare(\Drupal::VERSION, '10.2.0', '<')) {
$this->installSchema('system', ['sequences']);
}

$this->entityTypeManager = $this->container->get('entity_type.manager');
$this->securityExtension = $this->container->get('bamboo_twig_security.twig.security');

Expand Down
85 changes: 6 additions & 79 deletions tests/src/Kernel/Render/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ protected function setUp(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('file');
$this->installSchema('file', 'file_usage');

// Since Drupal 10.2.0 installing the table sequences with the
// method KernelTestBase::installSchema() is deprecated.
if (version_compare(\Drupal::VERSION, '10.2.0', '<')) {
$this->installSchema('system', ['sequences']);
}

$this->installEntitySchema('media');
$this->installConfig(['field', 'system', 'image', 'file', 'media']);

Expand Down Expand Up @@ -142,18 +135,7 @@ public function testRenderImageFile() {

$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);

// Since Drupal 10.3 the image styles are rendered as avif.
if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.avif\?itok=.*" \/>/', $markup->__toString());
}
// Since Drupal 10.3 the image styles are rendered as webp.
elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.webp\?itok=.*" \/>/', $markup->__toString());
}
else {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg\?itok=.*" \/>/', $markup->__toString());
}
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.(avif|webp)\?itok=.*" \/>/', $markup->__toString());

// Ensure {{ bamboo_render_image(1, 'thumbnail', '') }}.
$renderer = $this->renderExtension->renderImage($file->id(), 'thumbnail', '');
Expand All @@ -166,18 +148,7 @@ public function testRenderImageFile() {

$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);

// Since Drupal 10.3 the image styles are rendered as avif.
if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.avif\?itok=.*" \/>/', $markup->__toString());
}
// Since Drupal 10.3 the image styles are rendered as webp.
elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.webp\?itok=.*" alt="" \/>/', $markup->__toString());
}
else {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg\?itok=.*" alt="" \/>/', $markup->__toString());
}
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.(avif|webp)\?itok=.*" \/>/', $markup->__toString());

// Ensure {{ bamboo_render_image(1, 'thumbnail', 'Dignissim ... primis') }}.
$renderer = $this->renderExtension->renderImage($file->id(), 'thumbnail', 'Dignissim dui dolor ipsum sapien habitant primis');
Expand All @@ -190,18 +161,7 @@ public function testRenderImageFile() {

$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);

// Since Drupal 10.3 the image styles are rendered as avif.
if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.avif\?itok=.*" \/>/', $markup->__toString());
}
// Since Drupal 10.3 the image styles are rendered as webp.
elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.webp\?itok=.*" alt="Dignissim dui dolor ipsum sapien habitant primis" \/>/', $markup->__toString());
}
else {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg\?itok=.*" alt="Dignissim dui dolor ipsum sapien habitant primis" \/>/', $markup->__toString());
}
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.(avif|webp)\?itok=.*" \/>/', $markup->__toString());
}

/**
Expand All @@ -228,18 +188,7 @@ public function testRenderImageMedia() {

$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);

// Since Drupal 10.3 the image styles are rendered as avif.
if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.avif\?itok=.*" \/>/', $markup->__toString());
}
// Since Drupal 10.3 the image styles are rendered as webp.
elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.webp\?itok=.*" \/>/', $markup->__toString());
}
else {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg\?itok=.*" \/>/', $markup->__toString());
}
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.(avif|webp)\?itok=.*" \/>/', $markup->__toString());

// Ensure {{ bamboo_render_image(1, 'thumbnail', '') }}.
$renderer = $this->renderExtension->renderImage($media->field_media_image->target_id, 'thumbnail', '');
Expand All @@ -252,18 +201,7 @@ public function testRenderImageMedia() {

$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);

// Since Drupal 10.3 the image styles are rendered as avif.
if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.avif\?itok=.*" \/>/', $markup->__toString());
}
// Since Drupal 10.3 the image styles are rendered as webp.
elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.webp\?itok=.*" \/>/', $markup->__toString());
}
else {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg\?itok=.*" alt="" \/>/', $markup->__toString());
}
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.(avif|webp)\?itok=.*" \/>/', $markup->__toString());

// Ensure {{ bamboo_render_image(1, 'thumbnail', 'Dignissim ... primis') }}.
$renderer = $this->renderExtension->renderImage($media->field_media_image->target_id, 'thumbnail', 'Dignissim dui dolor ipsum sapien habitant primis');
Expand All @@ -276,18 +214,7 @@ public function testRenderImageMedia() {

$markup = $this->renderer->renderRoot($renderer);
$this->assertInstanceOf(Markup::class, $markup);

// Since Drupal 10.3 the image styles are rendered as avif.
if (version_compare(\Drupal::VERSION, '11.2', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.avif\?itok=.*" \/>/', $markup->__toString());
}
// Since Drupal 10.3 the image styles are rendered as webp.
elseif (version_compare(\Drupal::VERSION, '10.3', '>=')) {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.webp\?itok=.*" alt="Dignissim dui dolor ipsum sapien habitant primis" \/>/', $markup->__toString());
}
else {
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg\?itok=.*" alt="Dignissim dui dolor ipsum sapien habitant primis" \/>/', $markup->__toString());
}
$this->assertMatchesRegularExpression('/^<img src=".*public\/antistatique\.jpg.(avif|webp)\?itok=.*" \/>/', $markup->__toString());
}

}
Loading