Add test requirements

This commit is contained in:
Alain Schlesser 2021-04-19 17:28:42 +01:00
parent 0b2b81e862
commit d4d002e627
3 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,6 @@
Feature: Profile a specific hook
@require-wp-4.0
Scenario: Profile all hooks when a specific hook isn't specified
Given a WP install
@ -11,6 +12,7 @@ Feature: Profile a specific hook
| template_redirect |
And STDERR should be empty
@require-wp-4.4
Scenario: Profile all callbacks when --all flag is used
Given a WP install
@ -21,7 +23,7 @@ Feature: Profile a specific hook
| smilies_init() | 2 | 0 |
| feed_links() | 8 | 0 |
@less-than-php-7
@less-than-php-7 @require-wp-4.0
Scenario: Profile an intermediate stage hook
Given a WP install
@ -35,6 +37,7 @@ Feature: Profile a specific hook
runcommand\Profile\Profiler->wp_tick_profile_begin()
"""
@require-wp-4.0
Scenario: Profile a hook before the template is loaded
Given a WP install
@ -43,6 +46,7 @@ Feature: Profile a specific hook
| callback |
And STDERR should be empty
@require-wp-4.0
Scenario: Profile a hook without any callbacks
Given a WP install
@ -52,6 +56,7 @@ Feature: Profile a specific hook
| total (0) |
And STDERR should be empty
@require-wp-4.0
Scenario: Profile a hook that has actions with output
Given a WP install
@ -63,6 +68,7 @@ Feature: Profile a specific hook
<meta name="generator"
"""
@require-wp-4.0
Scenario: Profile the shutdown hook
Given a WP install
And a wp-content/mu-plugins/shutdown.php file:
@ -82,6 +88,7 @@ Feature: Profile a specific hook
| total (2) | 0 | 1 |
And STDERR should be empty
@require-wp-4.0
Scenario: Indicate where a callback is defined with profiling a hook
Given a WP install
And a wp-content/mu-plugins/custom-action.php file:
@ -101,6 +108,7 @@ Feature: Profile a specific hook
| total (1) | | 0 | 1 |
And STDERR should be empty
@require-wp-4.4
Scenario: Hooks should only be called once
Given a WP install
And a wp-content/mu-plugins/action-test.php file:
@ -122,7 +130,7 @@ Feature: Profile a specific hook
Warning: Called 1
"""
@less-than-php-7
@less-than-php-7 @require-wp-4.0
Scenario: Profile the mu_plugins:before hook
Given a WP install
And a wp-content/mu-plugins/awesome-file.php file:
@ -140,7 +148,7 @@ Feature: Profile a specific hook
wp-content/mu-plugins/awesome-file.php
"""
@less-than-php-7
@less-than-php-7 @require-wp-4.0
Scenario: Profile the :after hooks
Given a WP install

View file

@ -1,5 +1,6 @@
Feature: Profile the template render stage
@require-wp-4.0
Scenario: Profiler loads a summary table
Given a WP install
@ -10,6 +11,7 @@ Feature: Profile the template render stage
| main_query |
| template |
@require-wp-4.0
Scenario: Profiler loads a table with the correct hooks
Given a WP install
@ -79,6 +81,7 @@ Feature: Profile the template render stage
| loop_end:before |
| loop_end |
@require-wp-4.0
Scenario: Use --all flag to profile all stages
Given a WP install
@ -131,6 +134,7 @@ Feature: Profile the template render stage
Error: Invalid stage. Must be one of bootstrap, main_query, template, or use --all.
"""
@require-wp-4.0
Scenario: Identify callback_count for each hook
Given a WP install
@ -139,6 +143,7 @@ Feature: Profile the template render stage
| hook | callback_count |
| muplugins_loaded | 2 |
@require-wp-4.0
Scenario: Use spotlight mode to filter out the zero-ish values
Given a WP install

View file

@ -33,6 +33,7 @@ Feature: Basic profile usage
Error: 'SAVEQUERIES' is defined as false, and must be true. Please check your wp-config.php
"""
@require-wp-4.0
Scenario: Profile a hook without any callbacks
Given a WP install
@ -42,6 +43,7 @@ Feature: Basic profile usage
| total (0) | |
And STDERR should be empty
@require-wp-4.0
Scenario: Trailingslash provided URL to avoid canonical redirect
Given a WP install