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?
- Jest Unit tests for High order component containing Block Editor
- What is a sanity test/check
- C++ IDE for Macs
- How can I solve the error LNK2019: unresolved external symbol – function?
- What is an “internal error” and how do I fix it?
- How can I time a code segment for testing performance with Pythons timeit?
- C++ IDE with repl?
- Unresolved reference issue in PyCharm
- Difference between WebStorm and PHPStorm
- IDE for OCaml language
- Anyone know how to solve the error of “collect2.exe: error: ld returned 1 exit status” when a program in C is running?
- How to measure test coverage in Go
- MOCKITO: What is it and how is it different from Junit
- What’s a good IDE for Erlang programming?
- Verify a method call using Moq
- How to clear gradle cache?
- eclipse for chrome?
- Chrome Error: You are using an unsupported command-line flag: –ignore-certifcate-errors. Stability and security will suffer
- Does Notepad++ show all hidden characters?
- How do I autoindent in Netbeans?
- Re-enable “component tree” in Android Studio
- Scheme IDE for Windows
- ReferenceError: describe is not defined NodeJs
- Professional VHDL IDE?
- Proper way to assert type of variable in Python
- How to perform unit testing on proposed patches in Trac?
- Where can I find documentation for the WP_UnitTestCase factory classes?
- Best Practices for Regression Testing WordPress Websites?
- Unit testing for plugin development
- How do I mock HTTP requests for PHPUnit?
- Access post from post id in URL
- Show different theme for admin?
- Vagrant script to setup all the common PHP / WordPress version combinations
- Any guides on using WP SVN with IDE clients? [closed]
- WordPress Themes and PHP unit
- PHP unit testing WordPress?
- When unit testing a plugin, does the plugin need to be in the wp-content/plugins directory of the WordPress tests install?
- How to set up a user inside unit tests
- WordPress test environment on windows
- WordPress Unit Testing – Cannot Create Tables
- Can I simulate a user being logged in from a WP_UnitTestCase?
- Creating Unique Post URLs for A/B Testing… Is this even possible?
- Plugin Unit Test for Table and Option Creation
- How to write testable classes in WordPress
- Tutorials for Unit-Testing in WordPress and for unit-test.svn.wordpress.org?
- Writing a unit test for add_menu_page