Skip to content

Instantly share code, notes, and snippets.

@thanhluu
Last active October 21, 2015 08:52
Show Gist options
  • Save thanhluu/83abfaba3fe306271939 to your computer and use it in GitHub Desktop.
Save thanhluu/83abfaba3fe306271939 to your computer and use it in GitHub Desktop.
Install WordPress for Testing via WP-CLI
wp core config --dbname=<$dbname> --dbuser=<$dbuser> --dbpass=<$dbpass>;
wp db reset --yes;
wp core install --url=<$url> --title=<$title> --admin_name=<$admin> --admin_email=<$email> --admin_password=<$password> --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP;
curl -f https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml -o /tmp/theme-unit-test-data.xml;
wp import /tmp/theme-unit-test-data.xml --authors=skip;
wp plugin install developer --activate;
wp plugin install theme-check --activate;
wp plugin install debug-bar --activate;
wp plugin install log-deprecated-notices --activate;
wp plugin install debogger --activate;
wp plugin install monster-widget --activate;
wp plugin install wordpress-beta-tester --activate;
wp plugin install regenerate-thumbnails --activate;
wp option update blogname "WordPress Theme Unit Test Site";
wp option update posts_per_page 5;
wp option update thread_comments 1;
wp option update thread_comments_depth 3;
wp option update page_comments 1;
wp option update comments_per_page 5;
wp option update medium_max_w "";
wp option update medium_max_h "";
wp option update large_max_w "";
wp option update large_max_h "";
wp option update permalink_structure "/%year%/%monthnum%/%day%/%postname%/";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment