In order of preference:
composer require wp-phpunit/wp-phpunit --dev
. Depending on the IDE you use you might need to mark the package invendor/
as a source directory.- Each IDE allows you to add definitions from external libraries. In PHPStorm it’s
Settings → Languages & Frameworks → PHP → Include Path
. - Just copy the files over to some directory in your project and exclude them with
.gitignore
(if you use Git for version control).
Related Posts:
- Coverage in integration tests
- Testing hooks callback
- Proper unit testing in WordPress
- Using wp_mail during an integration test
- WP_UnitTestCase missing?
- Integration tests don’t register menu
- Am I testing this right?
- Is there a way to mock update_option for unit testing?
- WordPress Automatic Testing Probelm
- Set up PHPUnit with WordPress: The WordPress tests are 3 – 4 years old; does it matter?
- Integration test – remove the mu plugins in the test
- Unit Test ignores stubbed method second time around in a dataProvider
- How do I activate a plugin while testing?
- How do I simulate a registration form submission while testing?
- Testing Plugin – Install plugin dependencies in testing enviroment
- Exception in thread “main” java.lang.Error: Unresolved compilation problems
- Exception in thread “main” java.lang.Error: Unresolved compilation problems
- What’s the difference between a mock & stub?
- How can I test that a variable is more than eight characters in PowerShell?
- How to run only one unit test class using Gradle
- How to configure “Shorten command line” method for whole project in IntelliJ
- Unit testing in the WordPress backend (is_admin() is true)
- Developing, Testing and Releasing
- Unit tests – Dealing with dependencies
- Writing test cases for a WordPress Plugin that has translations
- PHPUnit testing WordPress Plugin
- Can I get at WordPress code from inside a Selenium test?
- Why Can’t PHPUnit UnitTest My WordPress Website
- Revert WordPress default options after a PHPUnit test has run
- How to properly test a method that is called by an action hook
- What’s the proper method of installing a plugin during unit testing?
- How to add an image for unit testing?
- Why is WP_Mock not used instead of WP_UnitTestCase for writing unit tests by most plugins?
- Duplicate a WordPress Install for Testing Purposes
- How to initialize something in unit test before the init hook being called?
- PHPSpec and WordPress
- Rest API in integration tests – filtering by slug not working?
- PHPUnit Plugin Integration Tests: Getting wordpress-tests-lib PHP into IDE (VS Code)
- Can’t run WP e2e-test-utils because the browser exits on login?
- How do I phpunit test a post output process?
- Integration testing – test is_wp_error in the code?
- How to use WordPress methods (themes, plugins, context) with Behat?
- why my must use plugins (mu-plugins) not work at localhost?
- How do I get PHPUnit Polyfills set up for testing on a mac?
- Integration tests test script enqueue/register fails
- Available methods for a/b testing the content
- Testing performance of WordPress files
- Mocking WP_CLI static methods in unit tests
- PHPUnit Testing and woocommerce Constant
- Unable to find PHPUnit code coverage stats
- can I run the test suite without a web server?
- Running plugin unit tests vs. integration tests?
- How do I package and distribute my WordPress plugin via git?
- ACF – programmatically install and activate in pipeline to automate testing for custom plugin development?
- What is a sanity test/check
- How can I time a code segment for testing performance with Pythons timeit?
- How to clear gradle cache?
- eclipse for chrome?
- Does Notepad++ show all hidden characters?
- Scheme IDE for Windows
- Professional VHDL IDE?
- Where can I find documentation for the WP_UnitTestCase factory classes?
- Best Practices for Regression Testing WordPress Websites?
- Show different theme for admin?
- How to set up a user inside unit tests
- WordPress test environment on windows
- Programmatically create blogs with dummy content on a WPMU site
- What areas to Unit test while building a plugin?
- how to test a theme upgrade
- How can I properly set up dependencies in automated testing?
- Install and load additional plugins when running unit tests
- How to disable redirect on test/staging copy of wordpress site
- How do I mock get_adjacent_post for testing
- WordPress function gives different results outside vs inside PHPUnit test
- automated tests as a user?
- PHP logging framework to be used with WordPress
- How to change the admin/password when using the E2E Test Utils for Gutenberg
- How to verify meta box is registered in Unit Testing?
- Deploy WordPress From Local Docker to Hosting Provider
- Is there a way to activate different theme for specified users? [closed]
- Plugin development: How many plugin and WordPress version combinations to support?
- How exactly *does* unit testing work for themes?
- Unit Test in WordPress
- What is the best way to create a factory for unit test objects?
- How to test drive WordPress on VPS with LEMP stack before going live?
- WordPress installation site folder move to the final site destination
- How do I Import an Exisiting WP Project into Aptana 3? [closed]
- WordPress themes that are browser tested and maintained?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Intermittent database errors when accessing WordPress database
- How to run subversion and staging environments when running WordPress
- How to split test a menu item
- A/B testing of posts with unique URLs for each variant AND editing in custom fields
- Duplicated site isn’t recognized as a site
- Change post date for testing purposes
- Unable to get a simple plugin admin page to work
- What is the best way to setup WordPress for version control and PhpStorm while allowing updates
- Cloning production site down to local?
- Unit Testing action hook
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?