Skip to content
Closed
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
34 changes: 34 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
env:
WP_MULTISITE: ${{ matrix.multisite }}
strategy:
# Report every matrix leg's own result rather than the default fail-fast
# cancelling the others as soon as one fails - same reasoning as cypress.yml's
# `fail-fast: false`.
fail-fast: false
matrix:
include:
- php: 7.4
Expand All @@ -30,6 +34,9 @@ jobs:
- php: 8.0
wordpress: 6.9
multisite: 0
- php: 8.0
wordpress: trunk
multisite: 0

name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }}
steps:
Expand All @@ -53,6 +60,33 @@ jobs:
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
sed -i "s/yourusernamehere/root/" wp-tests-config.php
sed -i "s/yourpasswordhere/root/" wp-tests-config.php

# A release branch (e.g. 6.9) ships pre-built dist/minified assets under `src/`;
# a raw `trunk` checkout doesn't, so it hits unrelated core code paths that
# expect them to already exist (wp_maybe_inline_styles's dist stylesheet check,
# wp-admin CSS minification for e.g. view-transitions.min.css). Build them the
# same way core's own CI does (reusable-build-package.yml: npm ci && npm run
# build), but with the `:dev` variant so the output lands in `src/` (Gruntfile's
# WORKING_DIR under `--dev`) where WP_DEVELOP_DIR points, instead of the plain
# build's separate `build/` package directory.
#
# Node version comes from the WP core checkout's own `.nvmrc`, not this
# runner's default - core's `engines.node` requirement moves with trunk and the
# runner default (Node 22 as of this writing) already trails it (WordPress#7.2.0
# requires >=24.18.0).
- name: Set up Node for WP core's build (trunk only)
if: matrix.wordpress == 'trunk'
uses: actions/setup-node@v4
with:
node-version-file: /tmp/wordpress/.nvmrc

- name: Build WP core assets (trunk only - release branches ship these pre-built)
if: matrix.wordpress == 'trunk'
timeout-minutes: 5
run: |
cd /tmp/wordpress
npm ci
npm run build:dev
- name: Creating database
run: |
sudo /etc/init.d/mysql start
Expand Down
9 changes: 9 additions & 0 deletions tests/phpunit/styles/test_FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public function test_front_head() {
ob_start();
wp_head();
$styles = ob_get_clean();

// wp_maybe_inline_styles() (WP core, unrelated to anything Formidable enqueues)
// flags a core stylesheet's dist asset as unreadable whenever this environment's
// WP checkout doesn't have its built dist/ files on disk - a property of the
// checkout, not the WP version under test, so a released-branch job may never
// see it while an unbuilt trunk checkout always does. Discard it either way
// rather than requiring it to fire.
unset( $this->caught_doing_it_wrong['wp_maybe_inline_styles'] );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmStylesController::$caught_doing_it_wrong


This issue is raised when an attempt is made to access an undefined property.
This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmStylesController::$caught_doing_it_wrong


The property you are trying to access is not defined and will cause unexpected behavior when used.


$this->assertNotEmpty( $styles );

$frm_settings = FrmAppHelper::get_settings();
Expand Down
Loading