Skip to content

Latest commit

 

History

History
33 lines (17 loc) · 1.06 KB

README.md

File metadata and controls

33 lines (17 loc) · 1.06 KB

TaxJar Unit Tests

Initial Setup

  1. PHPUnit and other dev dependencies are installed automatically via composer install. To ensure you've installed it correctly, check the version:

    $ vendor/bin/phpunit --version

  2. Install WordPress and the WP Unit Test lib using the install.sh script. Change to the plugin root directory and type:

    $ tests/bin/install.sh [db-host]

Important: The <db-name> database will be created if it doesn't exist and all data will be removed during testing.

Sample usage:

$ tests/bin/install.sh taxjar_tests root root
  1. Set your TaxJar API key as a environment variable with the key of TAXJAR_API_TOKEN.

    $ export TAXJAR_API_TOKEN='123456789abcdef'

  2. Make sure you have the WooCommerce plugin downloaded to your plugins directory.

Running Tests

Go to the /tests directory in the command line and type:

$ ../vendor/bin/phpunit

You can run specific tests by providing the path and filename to the test class:

$ ../vendor/bin/phpunit --testsuite=taxjar