One is official, the other one is a 3rd party library by 10up, so people tend to use the official WP_UnitTestCase
There is no right or wrong choice however, use the library you prefer
Is there anything I am missing out here?
No, some tests that core conducts require a temporary WP install to fully test. Some older APIs weren’t built for test isolation. As such, WP_UnitTestCase
and WP_Mock
are both capable of unit tests, but WP_UnitTestCase
is also used for other kinds of tests.
For your purposes as a plugin or theme author though, that particular information is irrelevant, and both are options. It really is up to your personal preference
Related Posts:
- Unit tests – Dealing with dependencies
- PHPUnit testing WordPress Plugin
- PHPUnit Testing and woocommerce Constant
- Unit testing for plugin development
- Vagrant script to setup all the common PHP / WordPress version combinations
- How to write testable classes in WordPress
- Implement phpunit testing on a plugin
- Unit testing to simulate the loop
- What is the best way to do unit tests for your plugin in 2018 [closed]
- Plugin development with unit tests
- Unit testing wordpress plugins with plugin options
- Install and load additional plugins when running unit tests
- Unit Testing a Plugin functionality with cron
- PHPUnit test plugin activation
- Sample — test — data for large WordPress install
- DataBase connection problem with PHPUnit and WordPress
- how to set context in WordPress for unit testing
- PHP logging framework to be used with WordPress
- Best way to notify WordPress plugin users of new release candidates for beta testing?
- Plugin development: How many plugin and WordPress version combinations to support?
- Unit testing a plugin with a theme dependency
- Mock a dependency of a WP_REST_Controller class
- Unit Testing action hook
- How can I measure CPU and RAM used by my theme or plugin
- Testing Plugins for Multisite
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- PHPUnit Testing Installation Issue
- Testing Plugin – Install plugin dependencies in testing enviroment
- ACF – programmatically install and activate in pipeline to automate testing for custom plugin development?
- Plugin – create a page without it appearing in the side menu
- Is wp-content/install.php a Drop-in?
- Using wp_filesystem in Plugins
- get_template_part from plugin
- Edit or Remove Plugin .htaccess Using The Admin Panel
- WordPress scheduled task is called but not executed
- How to create collections that are edited in admin?
- How can I call “preview post” from wp_remote_get with authentication?
- When is it too late to call the action wp_enqueue_scripts?
- Use js script from one plugin in another plugin
- Rest Api How to get results of child categories with one api call
- Plugin Loading Scripts and Styles on Every Page – Even when not being used
- Build dynamic page from cURL (HTML page) response with plugin
- How to store accumulate multiple option values in a single array using Options_API
- template_redirect for single posts w/ custom fields
- can I prevent WP users (even admin) from deleting custom categories?
- How to Add Page Template from Plugin without Losing $this
- Extend plugin options page
- Backslashes being stripped from CSS
- Uploading images from a custom page using blueimp uploader?
- Extending WP_List_Table seems getting wrong with $this->get_columns() – what’s wrong?
- Why doesn’t flush_rewrite_rules run on plugin activation?
- Finding posts containing matching array elements in a meta field usign WP_Query
- Namespaced action and filter tags
- Adding Dropbox dropin js using wp_enqueue_script
- Proper way to pass credentials in a custom login form to avoid “headers already sent”
- WordPress Multisite with Azure B2C redirect_urls after Login
- Can Page Templates be Applied to Archive and Post Templates?
- WooCommerce Admin Reports : Get custom product report based on date range
- Auto gallery from folder contents
- Adding (blog-specific) links to “My Sites” admin page
- Is there a plugin that will allow a tag cloud to be created from any mysql field?
- How to enable sorting in custom media uploader in plugin
- Allow users to add / remove settings in plugin
- Update problem with update_option() in combination with register_setting()
- Why does my widget break other widgets?
- How do I add a text field under the activity texarea? [closed]
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- How to make “upgrade safe” theme for a plugin?
- Function/Class to list categories with checkboxes
- Is it possible to enable and disable wp debug from functions.php?
- Default settings aren’t used
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Is hint for translator compulsory while internationalizing a string containing variables?
- Settings API: Setting default option via ‘get_option’ fails
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- How to use nonce
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- How do I validate extra pin field on my WordPress login form page?
- Does WordPress default CSS have Grids?
- Make a php array load faster
- Count products with custom metadata field in an order
- Adding the image selector/uploader to an admin back page
- setTimeout not working in jquery
- Woocommerce Product finder feature on home page
- How do I show the HTML descrption in wordpress photo gallery for my individual gallery pages?
- Adding and handling custom settings tab to fusion element
- WordPress Reset password Strength set to medium
- Add language localisation to javascript alert?
- redirect_to how to make it simply work with get parameter or similar?
- How I can give access to my custom plugin for editor roles user?
- Should all roles be allowed CRUD operation on the database?
- Associating special meaning with user id 0
- Filter get_user_by instead of replace function
- WP: adding Javascript to specific woo commerce pages
- How to create a custom search form and handler?
- Method to retrieve category names and IDs only as an array?
- How To Remove The Filter That Adds JetPack Related Content To Dom [closed]
- Fixing plugin for wpdb::prepare
- Using “add_image_size” to register custom image sizes inside plugins not working
- How do I access the contents of WordPress Classic editor in admin area with JavaScript?