Skip to content

Release 2.2.0#245

Merged
defunctl merged 22 commits into
mainfrom
2.2.0
May 29, 2026
Merged

Release 2.2.0#245
defunctl merged 22 commits into
mainfrom
2.2.0

Conversation

@defunctl

@defunctl defunctl commented May 29, 2026

Copy link
Copy Markdown
Contributor

Add PHP 8.4 + 8.5 Images

  • This also adds support for PHP 8.4 images, however uopz has not been pushed to pecl still, so for >= 8.4, we need to build it from source. The Dockerfile has been updated to reflect this. It was last updated in 2021, so if it ever gets updated, we can remove the git clone logic: https://pecl.php.net/package/uopz
  • I've also updated the Dockerfiles to use Amazon's public.ecr.aws image repository so we no longer get rate limited by docker.

Main Changes

In addition to the merged PR's, this provides a number of changes to the theme functionality.

Refactor Summary

Refactored slic target path resolution to be target-aware instead of mode-aware.

Previously, get_project_local_path() and get_project_container_path() inferred paths from the global slic here mode. That broke once a single slic context could expose both plugin and theme targets.

This refactor adds get_target_content_type() and updates the project path helpers so each selected target resolves independently as a plugin, theme, or site target.

Notable Changes

  • Added target-aware content type resolution for plugin, theme, and site targets.
  • Updated local/container path helpers to resolve paths based on the selected target.
  • Preserved legacy plugin-directory fallback behavior.
  • Added explicit ambiguity handling when the same slug exists as both a plugin and theme.
  • Updated command/build helpers to pass explicit targets into path resolution instead of relying on global current state.
  • Added SLIC_CURRENT_PROJECT_CONTAINER_PATH so container-side tooling can use the resolved target path directly.
  • Kept site targets resolving locally to SLIC_HERE_DIR to preserve site/WP skeleton behavior.
  • Fixed - slic run now repairs stale or incomplete WordPress .htaccess rewrite blocks in the configured SLIC_WP_DIR, preventing Apache-level 404s for pretty REST API URLs.

bordoni and others added 10 commits April 4, 2026 21:39
Add the skills/slic/ directory following the Agent Skills specification
(agentskills.io). SKILL.md is the entry point with frontmatter, workflow
overview, and links to sub-documents. test-anatomy.md covers test file
skeleton, naming, namespaces, and the AAA pattern. environment-setup.md
describes three tiers of setUp/tearDown complexity.
Add tutorial-style guides for HTTP mocking (3 patterns), assertions
with WordPress factories, advanced patterns (REST dispatch, Reflection,
custom tables), and an 11-item test isolation checklist.

Add reference docs for the complete slic CLI command set, setup and
CI configuration, and the wp-browser WPLoader module with coverage
of both v3 and v4 API differences.
Add a new "Agent Skills (AI-assisted testing)" section to the README
with a table of contents entry. Describes what the skill provides,
how AI agents discover it, and how to install it in other projects.
Include global (-g), per-project, per-agent (--agent), and list
(--list) install commands matching the skills CLI options.
When `slic here` is run from a themes directory (without wp-config.php),
slic previously entered "plugins directory mode" and set SLIC_PLUGINS_DIR
to the themes directory. This caused plugins like WooCommerce to be cloned
and installed inside wp-content/themes/, and Docker mounted the themes dir
as wp-content/plugins/ in the container.

This commit introduces proper theme-directory mode:

- Add `slic_here_is_themes()`: returns true when SLIC_HERE_DIR matches
  SLIC_THEMES_DIR, indicating slic was pointed at a themes directory.

- Update `get_valid_targets()`: include themes as valid `slic use` targets
  when in themes-directory mode (previously only included when slic_here_is_site()).

- Fix `run.php`: replace `slic_plugins_dir(slic_target())` with
  `get_project_local_path()` so the host-side Codeception config lookup
  resolves to SLIC_THEMES_DIR/<theme> for theme targets instead of always
  falling back to SLIC_PLUGINS_DIR.

- Fix `using.php`: same path resolution fix for the displayed target path.

- Fix `build_command_pool()` and `maybe_build_install_command_pool()` in
  slic.php: use `get_project_local_path()` for composer/npm build file
  detection so these commands work correctly for theme targets.

`get_project_local_path()` and `get_project_container_path()` in
project.php already handled the 'theme' project type correctly — this
change ensures the rest of the codebase uses them consistently.

- Update README: document the themes directory as a first-class `slic here`
  option (option 2, before the WordPress root option), including the correct
  WPLoader suite config pattern for activating a theme under test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inline fixes:
- Replace static::factory() with $this->factory() across all files
- Change setUp/tearDown visibility from public to protected
- Use PHP 7.4+ typed properties (int, array, \Closure)
- Fix test method separator from : to :: in slic run examples
- Add slic cc clean to command examples
- Add Playwright version note and install command
- Add table prefix collision warning in WPLoader config
- Add visibility column to lifecycle methods table
- Rework CI GitHub Actions example with PHP matrix and without
  slic init (projects should commit slic config files)

New content:
- composer.json PSR-4 test namespaces and suite namespace config
- Custom base TestCase with DI Container integration pattern
- dump.sql best practices (keep minimal, tests create own data)
- GitHub Actions PHP version matrix example
Co-authored-by: Justin <defunctl@users.noreply.github.com>
Per review feedback from defunctl: the test_ prefix is less noise
and less work than @test annotations (no docblock needed). Updated
all code examples across skill files to use test_ prefix, and
flipped the recommendation in test-anatomy.md to list test_ prefix
as the preferred style.
When `slic here` runs from a themes directory (no wp-config.php), detect a
sibling `plugins/` directory and set SLIC_THEMES_DIR to the current directory
and SLIC_PLUGINS_DIR to the sibling. This makes SLIC_HERE_DIR === SLIC_THEMES_DIR
so get_project_type() resolves theme targets without a manual .env.slic.run edit.

Guarded with a `basename === 'themes'` check so running `slic here` from
`wp-content/plugins` does not falsely enter themes mode. Covers standard
WordPress (wp-content/) and Bedrock (content/) layouts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@defunctl defunctl self-assigned this May 29, 2026
@defunctl
defunctl marked this pull request as ready for review May 29, 2026 20:43
@defunctl
defunctl requested a review from d4mation May 29, 2026 20:50
@defunctl
defunctl requested a review from estevao90 May 29, 2026 21:20

@dpanta94 dpanta94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Im not reading through the skills which i think we should move them to their own repo.

Other than that it looks good!

@defunctl
defunctl merged commit 44adae3 into main May 29, 2026
64 of 65 checks passed
@defunctl
defunctl deleted the 2.2.0 branch May 29, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants