Skip to content

Commit

Permalink
Update development readme
Browse files Browse the repository at this point in the history
- Instructions on running unit tests
- Listed dependencies
  • Loading branch information
ryanvalentin committed Feb 14, 2018
1 parent 65927f7 commit 8ad1e58
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@

There's a Docker configuration to bootstrap a local WordPress installation. To start it:

- From the root directory, run `$ make run`.
- You'll need both [Docker](https://docs.docker.com/install/) and [yarn](https://yarnpkg.com/) installed on your local machine.
- From the root directory, run `$ yarn` to install the frontend dependencies.
- Once that's done, run `$ make run` to build the docker image.
- Install wordpress with the default values by running `$ make install`.
- Activate the Disqus plugin using `$ make activate`.
- Alternatively you can now complete configuration by going to: http://localhost:8888/wp-admin/install.php
- Otherwise you can continue to: http://localhost:8888/

## Install
### Unit tests

To run unit tests locally:

- Install [Composer](https://getcomposer.org/), [yarn](https://yarnpkg.com/) and [MySQL](https://dev.mysql.com/doc/refman/5.7/en/installing.html).
- From the root project directory, run `$ yarn`, `$ composer install` and `$ composer global require "phpunit/phpunit=4.8.*"` (You may change the version to `6.*` if you're running PHP >= 7.0).
- To create the WordPress test instance, run `$ bash bin/install-wp-tests.sh wordpress_test root '' localhost latest`
- You should now be able to run `$ make test` to run both the PHPUnit tests and the frontend JavaScript tests.

## Installing to existing WordPress site

To install the plugin on an existing WordPress site, you'll need to build the frontend and create a .zip file:

- From the root directory, run `$ make js`.
- Compress the entire `disqus` directory into a `.zip` file.
- Make sure you have [yarn](https://yarnpkg.com/) installed on your local machine.
- From the root directory, run `$ make dist`.
- From your WordPress plugin page, select Plugins->Add New->Upload Plugin and choose the `disqus.zip` file you created.
- Activate the plugin and then install using the instructions in the plugin.

Expand Down

0 comments on commit 8ad1e58

Please sign in to comment.