The Substack Importer is a WordPress plugin that allows you to import a Substack export into your WordPress site.
Testing the plugin locally is easiest done by using wp-env.
The easiest way to run manual and unit tests for the Substack Importer is by using wp-env. The instructions here assume you are using wp-env.
Steps:
- Install wp-env globally and add a .wp-env.json file. You can use the example below.
{
"core": null,
"plugins": [".", "../wxr-generator", "WordPress/wordpress-importer"],
"port": 1000,
"testsPort": 1001,
"config": {
"WP_DEBUG_DISPLAY": true
}
}-
As the substack importer depends on the wxr-generator and wordpress-importer plugin, make sure you have added both of them to the
pluginsfield. This field contains a list of plugins to be loaded and enabled. -
Run
wp-env startin the substack-importer plugin directory. This will fire up a couple of Docker containers that give you access to a working WordPress instance.
To run unit tests some composer dependencies need to be installed. We can run composer and install the dependencies by running th following command inside the substack-importer directory:
wp-env run cli --env-cwd=wp-content/plugins/substack-importer composer install
Unit tests can now be ran with the following command:
wp-env run tests-cli --env-cwd=wp-content/plugins/substack-importer vendor/bin/phpunit --configuration=./phpunit.xml.dist
When a new tag is pushed, the tag will be published to SVN.