Skip to content

Conversation

@ilicfilip
Copy link
Collaborator

@ilicfilip ilicfilip commented Dec 15, 2025

WP CLI get task command wasnt working after recent refactors, this PR fixes it and adds tests for following WP CLI commands (if WP CLI is available):

  | test_task_list                           | Lists tasks in JSON format 
  | test_task_list_table_format              | Lists tasks in table format             |
  | test_task_create                         | Creates a task with required fields     |
  | test_task_create_without_required_fields | Verifies error without task_id/title    |
  | test_task_get                            | Gets a single task by ID                |
  | test_task_get_not_found                  | Verifies error for non-existent task    |
  | test_task_update                         | Updates a task's status                 |
  | test_task_delete                         | Deletes a task and verifies removal     |
  | test_full_crud_cycle                     | Complete create/read/update/delete flow |

@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2025

Test merged PR on Playground
Test this pull request on the Playground
or download the zip

@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2025

✅ Code Coverage Report

Metric Value
Total Coverage 30.99% 📉
Base Coverage 29.86%
Difference 📈 1.13%

⚠️ Coverage below recommended 40% threshold

🎉 Great job maintaining/improving code coverage!

📊 File-level Coverage Changes (1 files)

📈 Coverage Improved

Class Before After Change
Progress_Planner\WP_CLI\Task_Command 0.00% 83.78% +83.78%
ℹ️ About this report
  • All tests run in a single job with Xdebug coverage
  • Security tests excluded from coverage to prevent output issues
  • Coverage calculated from line coverage percentages

@github-actions
Copy link
Contributor

Composer package changes
Dev Packages Operation Base Target
composer/ca-bundle New - 1.5.10
composer/class-map-generator New - 1.7.0
composer/composer New - 2.9.2
composer/metadata-minifier New - 1.0.0
composer/spdx-licenses New - 1.5.9
eftec/bladeone New - 3.52
gettext/gettext New - v4.8.12
gettext/languages New - 2.12.1
justinrainbow/json-schema New - 6.6.3
marc-mabe/php-enum New - v4.7.2
mck89/peast New - v1.17.4
nb/oxymel New - v0.1.0
seld/jsonlint New - 1.11.0
seld/phar-utils New - 1.2.1
seld/signal-handler New - 2.0.2
symfony/polyfill-php73 New - v1.33.0
wp-cli/cache-command New - v2.2.1
wp-cli/checksum-command New - v2.3.2
wp-cli/config-command New - v2.4.0
wp-cli/core-command New - v2.1.22
wp-cli/cron-command New - v2.3.2
wp-cli/db-command New - v2.1.3
wp-cli/embed-command New - v2.1.0
wp-cli/entity-command New - v2.8.4
wp-cli/eval-command New - v2.2.7
wp-cli/export-command New - v2.1.14
wp-cli/extension-command New - v2.1.24
wp-cli/i18n-command New - v2.6.6
wp-cli/import-command New - v2.0.15
wp-cli/language-command New - v2.0.25
wp-cli/maintenance-mode-command New - v2.1.3
wp-cli/media-command New - v2.2.2
wp-cli/mustache New - v2.14.99
wp-cli/mustangostang-spyc New - 0.6.3
wp-cli/package-command New - v2.6.1
wp-cli/php-cli-tools New - v0.12.6
wp-cli/rewrite-command New - v2.0.16
wp-cli/role-command New - v2.0.16
wp-cli/scaffold-command New - v2.5.1
wp-cli/search-replace-command New - v2.1.9
wp-cli/server-command New - v2.0.15
wp-cli/shell-command New - v2.0.16
wp-cli/super-admin-command New - v2.0.16
wp-cli/widget-command New - v2.1.12
wp-cli/wp-cli New - v2.12.0
wp-cli/wp-cli-bundle New - v2.11.0
wp-cli/wp-config-transformer New - v1.4.3

@ilicfilip
Copy link
Collaborator Author

I have changed approach:

Initially WP CLI commands were triggered like they are triggered from the command line, using exec. This worked fine locally (since it actually ran in local repo, not the test WP instance) but didnt in CI. To make it work I had to symlink repo to the test WP instance, create wp-config.php, install WP core, activate the plugin, change wp table prefix..

Now the WP CLI commands are tested from PHP directly, not using the exec command. This doesn't require any of the above steps and it is much faster. Also it feels more natural since.. this are PHP Unit tests.
The only setup change is that WP CLI is now required as dev composer dependency.

@ilicfilip ilicfilip merged commit eb2cc71 into develop Dec 16, 2025
22 checks passed
@ilicfilip ilicfilip deleted the filip/wp-cli-tests branch December 16, 2025 08:59
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.

4 participants