pixline / wp-cli-theme-test-command Goto Github PK
View Code? Open in Web Editor NEWWordPress theme "unit tests" setup command with wp-cli
WordPress theme "unit tests" setup command with wp-cli
Add check for WP_DEBUG
and SAVEQUERIES
Actual command line options:
--data=<data> --menus --vip
Command have four steps, we need to make them scriptable. Proposal:
Default values marked with *
[--plugin=] ( theme* | vip | developer | skip ).
should accept multiple values, i.e.: theme,vip
[--data=] ( default* | custom URL | skip )
[--options=] ( full* | skip )
[--menus]
As in wp-cli/wp-cli#147 (comment) we could add built-in support to well known/supported alternative datafiles, if useful.
Candidates:
Proposal:
[--data=<data>] ( unit-test* | wptest | wpcandy | wpcom-theme | wpcom-demo | custom URL | skip )
I ran wp theme-test install
got this:
Failed to import Media “test-image-landscape-900”<br />Failed to import Media “test-image-portrait”<br />-- Added post_meta _wp_attachment_image_alt
Then this
-- Added post_meta _wp_attachment_image_alt
-- Added post_meta _attachment_original_parent_id
-- Added post_meta _wp_attachment_image_alt
-- Added post_meta _wp_attachment_image_alt
-- Added post_meta _attachment_original_parent_id
Then another
Failed to import Media “dsc20050727_091048_222”<br />Failed to import Media “dsc20050813_115856_52”<br />Failed to import Media “dsc20050831_165238_332”<br />Failed to import Media “dsc20050901_105100_212”<br />-- Added post_meta _wp_attachment_image_alt
Extra info
WP-CLI version: 0.11.0-alpha
```wordpress-importer: 0.6`
Updated the importer
Ok I saw that I didn't install the wordpress-importer but just kept it at 0.6.
Updated it to wordpress-importer: 0.6.1 and ran the command again.
Everything ok.
So maybe use the new plugin install wordpress-importer --force
to install this.
as subject, wth no plugins or --plugin=skip
data import will fail because importer is not active. check and maybe activate it before importing!
check for pages count before!
PHP Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in /src/wp-cli-theme-test-command/wp-cli-theme-test-command.php on line 31
PHP Stack trace:
PHP 1. {main}() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/boot-fs.php:0
PHP 2. include() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/boot-fs.php:17
PHP 3. WP_CLI\Runner->after_wp_load() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/wp-cli.php:37
PHP 4. WP_CLI\Runner->_run_command() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:369
PHP 5. WP_CLI::run_command() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:148
PHP 6. WP_CLI\Dispatcher\Subcommand->invoke() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/class-wp-cli.php:311
PHP 7. call_user_func() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:74
PHP 8. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:74
PHP 9. call_user_func() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:35
PHP 10. Theme_Test_Cmd->install() /src/wp-cli-theme-test-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:35
PHP 11. Theme_Test_Cmd->create_test_menus() /src/wp-cli-theme-test-command/wp-cli-theme-test-command.php:246
PHP 12. array_rand() /src/wp-cli-theme-test-command/wp-cli-theme-test-command.php:31
Now that Travis CI works, it's clear that I overlooked this one:
https://travis-ci.org/pixline/wp-cli-theme-test-command#L200
tl;dr: can't call wp
directly, as it could not be symlinked
I'm quite sure there's a way to pass recursive wp
commands without hardcoding but I just can't find it at a glance, I'll need to browse more.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.