I would like to run UI automated tests for my WordPress plugin. I am using Docker to run a WP instance and it runs my tests, that is fine. I am using wp-cli to install and config a testing site.

I would also like to run the test suite on multisite. For that, I need to setup a network. I know how to install a multisite network manually, but I need a command which I add to my Dockerfile. So my question is: Is there a way how to create a multisite network using command line script?

up vote 1 down vote accepted

Since you're already using WP-CLI, I recommend you to use the wp core multisite-install command to set up your network installation.

When you check out the documentation you'll see that it's pretty straightforward. Here's the example from the docs:

$ wp core multisite-install --title="Welcome to the WordPress" \
> --admin_user="admin" --admin_password="password" \
> --admin_email="user@example.com"
Single site database tables already present.
Set up multisite database tables.
Added multisite constants to wp-config.php.
Success: Network installed. Don't forget to set up rewrite rules.

You can perfectly use this command to set everything up in your Docker environment.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.