I found out why. here is the solution: you have to activate the plugin in the tests / bootstrap.php
file:
$GLOBALS[ 'wp_tests_options' ] = array(
'active_plugins' => array(
'YOUR-PLUGIN/YOUR-PLUGIN.php'
)
)
Related Posts:
- Unit tests – Dealing with dependencies
- How to write testable classes in WordPress
- PHPUnit testing WordPress Plugin
- 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
- Why is WP_Mock not used instead of WP_UnitTestCase for writing unit tests by most plugins?
- DataBase connection problem with PHPUnit and WordPress
- how to set context in WordPress for unit testing
- Unit testing a plugin with a theme dependency
- PHPUnit Testing and woocommerce Constant
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- PHPUnit Testing Installation Issue
- Unit testing for plugin development
- When is wp_loaded initiated only with admin or only when user enters the site or both?
- How would I create a plugin for my shortcodes?
- Does WP fire delete_post when trashed posts are automatically deleted?
- function triggered by “manage_users_custom_column” filter not working
- Save metabox with multiple checkbox array
- How does uninstalling WordPress plugins work?
- Error with Custom Admin Screen in iframe Thickbox
- How to list events by category and month with plugin Event Organiser?
- How to link to images in my plugin regardless of the plugin folder’s name
- ERROR: Options page not found – saving settings page with tabs
- Dropdown list of pages to get page id to store in plugin options
- Can I leave out `if ( ! defined …)` when defining plugin constants?
- Create a new page in a plugin
- Can I use namespaces in my plugin?
- Find source of notice / warning / errors efficiently
- Will cron job run if page loaded is being served from cache?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Access first name and last name from user_register
- Use wp_set_post_terms() instead of wp_insert_post()
- Woocommerce custom emails without header and footer
- How do I add a prefix when a user registers
- Check and load class of theme from a plugin
- TinyMCE 4.7.11 custom styles using styleselect – what does the ‘attributes’ argument do?
- Short code not working in boostrap modal dont no why?
- What is the proper way to include Bootstrap when executing a shortcode
- Create a free scripts and styles template within a plugin
- Is there a way to list all actions registered by a plugin or theme?
- How can I turn a custom wordpress page into a product page?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- How to enqueue style in WordPress plugin from theme files?
- Bootstrap version conflict 3 with 4 for wordpress theme and plugin [closed]
- pre_get_post alter current post id
- Auto-Populate Image After Media Upload
- Problems with cron
- update your existing plugin’s WordPress compatibility
- How dynamic action login_form_{action} is working
- WP Multisite login not working on one subsite. Possibly cookies/ history issue?
- dbDelta not installing database
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- Cannot get jQuery UI to enqueue in my plugin!
- Can I use %category% like Templates in my Plugin?
- Remove Default Blogroll Links via Plugin script
- Plugin path comes wrongly
- Catching Form Submission in WordPress Admin Panel
- Filter posts in pre_get_posts order by meta value date (desc or asc)
- How to display the category id along with category name on categories list?
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- Activate / Deactivate plugin
- How to validate inputs with filter in register_setting callback
- Problems with wierd characters and my plugin
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- wp_new_user_notifications to notify user and admin about new user registration
- Is it possible to use the MySQL’s ORDER BY FIELD() clause as part of the pre_get_posts hook?
- How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- Why User_login key doesn’t work with wp_update_user()
- How to limit number of category term display in home page grids?
- A question on init and activation hooks
- How to save multiple values in custom post type from front end to back end
- How to create plugin settings page for each admin user?
- Using JavaScript in WordPress page to call for server data using AJAX
- Headers already sent on custom plugin (Export function)
- Insert Data into Database
- login_message filter not working
- Displaying Custom Post Meta
- wp_enqueue_style don’t register all google fonts
- API WordPress is Limited? Return False
- How to return a blank page
- Array/List Edit in Backend
- How to Modify My Plugin’s Admin Settings so that the Plugin can be Added to a Specific Page?
- Does WordPress have something like timer hook?
- Same header/footer in Admin, across all network sites in multisite
- Template file structure , wordpress hook for altering the template
- Wrapping shortcodes in another shortcode
- How to display custom taxonomy and terms using/creating plugin template
- Display Data’s metabox in page
- WordPress multiple user roles accessing on their information on one site?
- How to add ‘use_desc_for_title = 0’ to all wp_list_categories calls?
- How can I start Plugin Development?
- Why is WordPress wrapping search for users that looks like integers with asterisks and how do I fix it?