Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
529c556
GH Actions: update a few links in inline comments
jrfnl Nov 17, 2023
71336da
GH Actions/test: PHP 8.3 has been released
jrfnl Nov 20, 2023
5829d2d
Merge pull request #68 from Yoast/JRF/ghactions-update-some-links
jrfnl Nov 23, 2023
7d462bc
Merge pull request #69 from Yoast/JRF/ghactions-php-8.3-has-been-rele…
jrfnl Nov 23, 2023
a801ad3
Composer.json: add link to security policy
jrfnl Sep 21, 2023
73fdd2a
GH Actions: switch to Coveralls action runner to upload reports
jrfnl Sep 16, 2023
d4659b6
Merge pull request #70 from Yoast/JRF/add-security-policy-file
jrfnl Nov 24, 2023
3b2dd8d
Merge pull request #71 from Yoast/JRF/ghactions-switch-to-coveralls-r…
jrfnl Nov 24, 2023
f31de12
CS: minor tweaks to comply with WordPressCS 3.0
jrfnl Sep 16, 2023
d0a8e4c
Merge pull request #72 from Yoast/JRF/cs-minor-tweaks
jrfnl Dec 14, 2023
2c9e056
Composer/PHPCS: update to YoastCS 3.0.0
jrfnl Dec 14, 2023
4656688
Merge pull request #73 from Yoast/JRF/CS/update-phpcs-ruleset-yoastcs…
jrfnl Dec 14, 2023
c902066
GH Actions: Bump ramsey/composer-install from 2 to 3
dependabot[bot] Mar 4, 2024
1d4ae68
Merge pull request #74 from Yoast/dependabot/github_actions/ramsey/co…
jrfnl Mar 4, 2024
7f8b706
Composer: update dev dependencies
jrfnl Apr 5, 2024
c0cff01
Composer: update PHPUnit Polyfills
jrfnl Apr 5, 2024
4b83bc7
Merge pull request #75 from Yoast/feature/composer-update-dev-depende…
jrfnl Apr 5, 2024
b5e3879
Composer: update BrainMonkey to `^2.6.2`
jrfnl Nov 7, 2024
88a975a
Merge pull request #79 from Yoast/feature/composer-update-dependencies
jrfnl Nov 7, 2024
aa2f775
GH Actions/test: anticipate PHP 8.4 release
jrfnl Nov 7, 2024
a5464a9
Merge pull request #80 from Yoast/JRF/ghactions/dont-fail-on-8.4
jrfnl Nov 7, 2024
ed1d8a1
Composer: prevent a lock file from being created
jrfnl Nov 7, 2024
24ebd6a
Merge pull request #81 from Yoast/JRF/composer-no-lock
jrfnl Nov 7, 2024
acf7b81
CS: minor tweaks
jrfnl Nov 7, 2024
6207808
Merge pull request #82 from Yoast/JRF/cs-minor-tweaks
jrfnl Nov 7, 2024
e395ab4
GH Actions: add actionlint job
jrfnl Dec 21, 2024
4ae111e
GH Actions: add merge-conflict check
jrfnl Dec 23, 2024
abdc43c
Merge pull request #83 from Yoast/JRF/ghactions-add-actionlint
jrfnl Dec 24, 2024
3a07eed
Merge pull request #84 from Yoast/JRF/ghactions-add-merge-conflict-check
jrfnl Dec 24, 2024
34ba59b
PHPCS: fix bug in ruleset
jrfnl Jan 5, 2025
430933b
Merge pull request #85 from Yoast/JRF/work-round-phpcs-bug
jrfnl Jan 5, 2025
65b2ed4
Composer: update to YoastCS 3.2.0
jrfnl Mar 20, 2025
565a00a
Merge pull request #86 from Yoast/JRF/update-yoastcs-3.2.0
jrfnl Mar 20, 2025
eb4a9f4
Dependabot: remove reviewers
jrfnl May 19, 2025
1c3f957
Merge pull request #88 from Yoast/JRF/feature/remove-dependabot-revie…
jrfnl May 19, 2025
4e3a52e
GH Actions: Bump actions/checkout from 4 to 5
dependabot[bot] Aug 18, 2025
05c9971
Merge pull request #89 from Yoast/dependabot/github_actions/actions/c…
jrfnl Aug 18, 2025
997935f
GH Actions: update for the release of PHP 8.5
jrfnl Nov 19, 2025
52c6005
Merge pull request #90 from Yoast/feature/ghactions-update-for-php-8.…
jrfnl Nov 19, 2025
cd69d12
GH Actions: Bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
fc551b7
Merge pull request #91 from Yoast/dependabot/github_actions/actions/c…
jrfnl Nov 24, 2025
41caf4c
README: fix a few badges
jrfnl Dec 28, 2025
1418b07
GH Actions/test: ensure all jobs have a name
jrfnl Dec 29, 2025
8cb1b59
Merge pull request #93 from Yoast/JRF/readme-fix-some-badges
jrfnl Dec 29, 2025
bf103a8
Merge pull request #94 from Yoast/JRF/ghactions-all-jobs-should-have-…
jrfnl Dec 29, 2025
20c3598
GH Actions: "pin" all action runners
jrfnl Dec 29, 2025
9abf2e7
Dependabot: update config
jrfnl Dec 29, 2025
6bd75bb
Merge pull request #95 from Yoast/JRF/ghactions-pin-action-runners
jrfnl Dec 29, 2025
9201f4a
GH Actions: do not persist credentials
jrfnl Dec 29, 2025
5d9cacc
Merge pull request #96 from Yoast/JRF/ghactions-do-not-persist-creden…
jrfnl Dec 29, 2025
6ac0c03
GH Actions: update PHP ini configuration
jrfnl Dec 29, 2025
ff5ca4a
GH Actions: fail "setup-php" if requested tooling could not be installed
jrfnl Dec 29, 2025
6b178c4
Merge pull request #97 from Yoast/JRF/ghactions-show-startup-errors
jrfnl Dec 29, 2025
9775501
Merge pull request #98 from Yoast/JRF/ghactions-setup-php-fail-fast
jrfnl Dec 29, 2025
33cd49c
GH Actions: fail "setup-php" if requested tooling could not be instal…
jrfnl Dec 29, 2025
352b75b
Merge pull request #99 from Yoast/JRF/ghactions-setup-php-fail-fast-2
jrfnl Dec 29, 2025
44007b2
Composer: update to YoastCS 3.3.0
jrfnl Feb 4, 2026
3096206
Merge pull request #100 from Yoast/JRF/composer-update-yoastcs
jrfnl Feb 4, 2026
68c34f7
Composer: update PHPUnit Polyfills
jrfnl Feb 4, 2026
1cf5154
Merge pull request #101 from Yoast/JRF/composer-update-phpunit-polyfills
jrfnl Feb 4, 2026
8303140
Composer: update the version constraint for BrainMonkey to `^2.7.0`
jrfnl Feb 5, 2026
d9309be
Merge pull request #102 from Yoast/JRF/composer-update-brainmonkey
jrfnl Feb 5, 2026
f741c18
Add release checklist
jrfnl Feb 5, 2026
204f0b0
Merge pull request #103 from Yoast/JRF/add-release-checklist
jrfnl Feb 5, 2026
0a17fc5
Changelog for release 1.2.1
jrfnl Nov 7, 2024
98aa23a
Merge pull request #104 from Yoast/JRF/changelog-1.2.1
jrfnl Feb 5, 2026
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
16 changes: 10 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "cron"
cronjob: "15 22 5,20 * *" # At 22:15, every 5th and 20th day of the month.
open-pull-requests-limit: 5
commit-message:
prefix: "GH Actions:"
labels:
- "yoastcs/qa"
reviewers:
- "jrfnl"
groups:
action-runners:
applies-to: version-updates
update-types:
- "minor"
- "patch"

# Maintain dependencies for Composer.
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
interval: "cron"
cronjob: "15 22 5,20 * *" # At 22:15, every 5th and 20th day of the month.
open-pull-requests-limit: 5 # Set to 0 to (temporarily) disable.
versioning-strategy: "increase-if-necessary"
commit-message:
prefix: "Composer:"
labels:
- "yoastcs/qa"
reviewers:
- "jrfnl"
30 changes: 30 additions & 0 deletions .github/release-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Release checklist
===========================================================

## Pre-release

- [ ] Composer: check if any dependencies/version constraints need updating - PR #xxx
- [ ] Add changelog for the release - PR #xxx
:pencil2: Verify that a release link at the bottom of the `CHANGELOG.md` file has been added.

## Release

- [ ] Create PR to merge the `develop` branch into `main`.
- [ ] Merge that PR
- [ ] Make sure all CI builds are green.
- [ ] Create a release from the tag (careful, GH defaults to `develop`!) & copy & paste the changelog to it.
Make sure to copy the links to the issues and the links to the GH usernames from the bottom of the changelog!
- [ ] Close the milestone.
- [ ] Open a new milestone for the next release.
- [ ] If any open PRs/issues which were milestoned for the release did not make it into the release, update their milestone.

## Announce

- [ ] Tweet about the release.


---

Additional actions to take, not part of the release checklist:
- [ ] Post a link to the release in the Yoast Slack.
- [ ] Update the test dependencies in Yoast packages.
18 changes: 13 additions & 5 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,33 @@ on:
workflow_dispatch:

jobs:
actionlint:
name: 'Lint GH Action workflows'
uses: Yoast/.github/.github/workflows/reusable-actionlint.yml@c14f66005ab514663a48d00712db67617c98728c # v1.0.0

checkcs:
name: 'Basic CS and QA checks'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: '7.4'
php-version: 'latest'
coverage: none
tools: cs2pr
env:
fail-fast: true

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/merge-conflict-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check PRs for merge conflicts

on:
# Check for new conflicts due to merges.
push:
branches:
- main
- develop
# Check conflicts in new PRs and for resolved conflicts due to an open PR being updated.
pull_request_target:
types:
- opened
- synchronize
- reopened

jobs:
check-prs:
if: github.repository_owner == 'Yoast'

name: Check PRs for merge conflicts
uses: Yoast/.github/.github/workflows/reusable-merge-conflict-check.yml@c14f66005ab514663a48d00712db67617c98728c # v1.0.0
66 changes: 28 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,46 @@ jobs:

strategy:
matrix:
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.3']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.6']
coverage: [false]

# Run code coverage only on high/low PHP.
include:
- php: 5.6
coverage: true
- php: 8.2
- php: 8.5
coverage: true

continue-on-error: ${{ matrix.php == '8.3' }}
continue-on-error: ${{ matrix.php == '8.6' }}

name: "Tests: PHP ${{ matrix.php }}"

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL, display_errors=On
ini-values: zend.assertions=1, assert.exception=1, error_reporting=-1, display_errors=On, display_startup_errors=On
coverage: ${{ matrix.coverage == true && 'xdebug' || 'none' }}
env:
fail-fast: true

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies - normal
if: matrix.php != '8.3'
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
# YoastCS 3.0 has a PHP 7.2 minimum which conflicts with the requirements of this package.
- name: 'Composer: remove YoastCS'
run: composer remove --dev yoast/yoastcs --no-update --no-interaction

- name: Install Composer dependencies - ignore PHP restrictions
if: matrix.php == '8.3'
uses: "ramsey/composer-install@v2"
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
with:
composer-options: --ignore-platform-req=php+
# For PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
composer-options: ${{ matrix.php == '8.6' && '--ignore-platform-req=php+' || '' }}
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

Expand All @@ -72,34 +73,23 @@ jobs:
if: ${{ matrix.coverage == true }}
run: composer coverage

# PHP Coveralls doesn't fully support PHP 8.x yet, so switch the PHP version.
- name: Switch to PHP 7.4
if: ${{ success() && matrix.coverage == true && startsWith( matrix.php, '8' ) }}
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none

# Global install is used to prevent a conflict with the local composer.lock in PHP 8.0+.
- name: Install Coveralls
if: ${{ success() && matrix.coverage == true }}
run: composer global require php-coveralls/php-coveralls:"^2.5.3" --no-interaction

- name: Upload coverage results to Coveralls
if: ${{ success() && matrix.coverage == true }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php }}
run: php-coveralls -v -x build/logs/clover.xml
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
format: clover
file: build/logs/clover.xml
flag-name: php-${{ matrix.php }}
parallel: true

coveralls-finish:
needs: test
runs-on: ubuntu-latest

name: Coveralls Finish

steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
parallel-finished: true
97 changes: 62 additions & 35 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Coding Standard for WP Test Utils" xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Check the code of WP Test Utils.</description>
<description>Check the code of WP Test Utils.</description>

<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->

<file>.</file>
<file>.</file>

<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>

<!-- Show progress, show the error codes for each message (source). -->
<arg value="ps"/>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="ps"/>

<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>

<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>

<!-- Cache the results between runs. -->
<arg name="cache" value="./.cache/phpcs.cache"/>
Expand All @@ -41,16 +41,33 @@
</property>
</properties>

<!-- Use CamelCaps file names to be more in line with the naming conventions used in PHPUnit. -->
<exclude name="Yoast.Files.FileName"/>
<!-- Exclude some rules which are irrelevant.
The code in this package is not run in the context of a WordPress plugin. -->
<exclude name="WordPress.DB"/>
<exclude name="WordPress.Security"/>
<exclude name="WordPress.WP"/>
<exclude name="Yoast.Yoast.JsonEncodeAlternative"/>
<exclude name="WordPressVIPMinimum.Classes.DeclarationCompatibility"/>
<exclude name="WordPressVIPMinimum.Hooks.AlwaysReturnInFilter"/>
<exclude name="WordPressVIPMinimum.Security.EscapingVoidReturnFunctions"/>
<exclude name="WordPressVIPMinimum.Security.ProperEscapingFunction"/>

<!-- Exclude select "modern PHP" sniffs, which conflict with the minimum supported PHP version of this package. -->
<exclude name="Modernize.FunctionCalls.Dirname.Nested"/><!-- PHP 7.0+. -->
<exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/><!-- PHP 7.0+. -->
<exclude name="PSR12.Properties.ConstantVisibility"/><!-- PHP 7.1+. -->
<exclude name="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/><!-- PHP 7.1+. -->
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/><!-- PHP 7.3+. -->
<exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/><!-- PHP 7.4+. -->
<exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/><!-- PHP 7.4+. -->

<!-- The code in this package is not run in the context of a plugin. -->
<exclude name="WordPress.WP.AlternativeFunctions"/>
<exclude name="Yoast.Yoast.AlternativeFunctions"/>
</rule>

<!-- Enforce PSR1 compatible namespaces. -->
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Classes.ClassDeclaration">
<!-- YoastCS only applies this rule to test files. Overrule it to apply to all files. -->
<include-pattern>*\.php</include-pattern>
</rule>


<!--
Expand All @@ -59,13 +76,21 @@
#############################################################################
-->

<rule ref="Yoast.NamingConventions.NamespaceName">
<rule ref="Yoast.Files.FileName">
<properties>
<property name="prefixes" type="array">
<element value="Yoast\WPTestUtils"/>
<property name="psr4_paths" type="array">
<element key="Yoast\WPTestUtils\Tests\\" value="tests/"/>
</property>
<property name="src_directory" type="array">
<element value="src"/>
</properties>

<include-pattern>/tests/*\.php</include-pattern>
</rule>

<rule ref="Yoast.NamingConventions.NamespaceName">
<properties>
<property name="psr4_paths" type="array">
<element key="Yoast\WPTestUtils\\" value="src/"/>
<element key="Yoast\WPTestUtils\Tests\\" value="tests/"/>
</property>
</properties>
</rule>
Expand All @@ -78,7 +103,7 @@

<rule ref="WordPress.PHP.NoSilencedErrors">
<properties>
<property name="custom_whitelist" type="array">
<property name="customAllowedFunctionsList" type="array">
<element value="file_exists"/>
</property>
</properties>
Expand All @@ -92,11 +117,6 @@
#############################################################################
-->

<!-- Allow filecomments in file which don't contain OO declarations. -->
<rule ref="Yoast.Commenting.FileComment.Unnecessary">
<exclude-pattern>/src/*/bootstrap*\.php$</exclude-pattern>
</rule>

<!-- Declaring a few WordPress native constants. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound">
<exclude-pattern>/src/BrainMonkey/bootstrap\.php$</exclude-pattern>
Expand All @@ -116,9 +136,16 @@
<exclude-pattern>/src/Helpers/*\.php$</exclude-pattern>
</rule>

<!-- Ignore word count for object names in tests. -->
<!-- TEST CODE -->

<!-- Final classes is irrelevant for test fixtures. -->
<rule ref="Universal.Classes.RequireFinalClass">
<exclude-pattern>/tests/*/Fixtures/*\.php$</exclude-pattern>
</rule>

<!-- Ignore word count for object names in test fixtures. -->
<rule ref="Yoast.NamingConventions.ObjectNameDepth.MaxExceeded">
<exclude-pattern>/tests/*\.php$</exclude-pattern>
<exclude-pattern>/tests/*/Fixtures/*\.php$</exclude-pattern>
</rule>

<!-- Test fixtures are not the actual tests. -->
Expand Down
Loading