Skip to content

WordPress Unit Test plugin for Windows and Local (by Flywheel) environment

Notifications You must be signed in to change notification settings

pixelstudio-id/pixel-wp-unit

Repository files navigation

Pixel Unit Test

This is a WordPress PHPUnit boilerplate for dev with Windows and using LocalWP.

Initial Setup

  1. Set Local's preference to use Git Bash as shell.

  2. Create a test database by opening Site Shell, cd to this plugin, and run bin/install-wp-tests.sh local_test root root localhost.

  3. Disable annoying imagick error by going to your site's folder of conf > php > php.ini.hbs and disable it by adding ; in front:

    [imagick]
    {{#if os.windows}}
    ;extension = php_imagick.dll
    {{else}}
    ;extension = {{extensionsDir}}/imagick.so
    {{/if}}
    
  4. Restart your site.

  5. Install all packages with composer update.

How to use:

  1. Edit wp-config.php to your needs. But leave the DB constant as is.

  2. Run the test using composer test. Use the shell from Local, make sure you cd to the plugin's directory before running the test.

That's it, you should see the assertion returning true. Now you can continue writing your unit test.

About

WordPress Unit Test plugin for Windows and Local (by Flywheel) environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published