Skip to content

Commit 67d57b7

Browse files
committed
Clean up some now obsolete tests
We require PHP 7.2 and WP 4.9 nowadays
1 parent 44bd90a commit 67d57b7

4 files changed

Lines changed: 1 addition & 74 deletions

File tree

features/profile-hook.feature

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Feature: Profile a specific hook
22

3-
@require-wp-4.0
43
Scenario: Profile all hooks when a specific hook isn't specified
54
Given a WP install
65

@@ -21,21 +20,6 @@ Feature: Profile a specific hook
2120
| callback | cache_hits | cache_misses |
2221
| sanitize_comment_cookies() | 0 | 0 |
2322

24-
@less-than-php-7 @require-wp-4.0
25-
Scenario: Profile an intermediate stage hook
26-
Given a WP install
27-
28-
When I run `wp profile hook wp_head:before --fields=callback,cache_hits,cache_misses`
29-
Then STDOUT should be a table containing rows:
30-
| callback | cache_hits | cache_misses |
31-
| parse_blocks() | 0 | 0 |
32-
| _get_wptexturize_split_regex() | 0 | 0 |
33-
And STDOUT should not contain:
34-
"""
35-
WP_CLI\Profile\Profiler->wp_tick_profile_begin()
36-
"""
37-
38-
@require-wp-4.0
3923
Scenario: Profile a hook before the template is loaded
4024
Given a WP install
4125

@@ -44,7 +28,6 @@ Feature: Profile a specific hook
4428
| callback |
4529
And STDERR should be empty
4630

47-
@require-wp-4.0
4831
Scenario: Profile a hook without any callbacks
4932
Given a WP install
5033

@@ -54,7 +37,6 @@ Feature: Profile a specific hook
5437
| total (0) |
5538
And STDERR should be empty
5639

57-
@require-wp-4.0
5840
Scenario: Profile a hook that has actions with output
5941
Given a WP install
6042

@@ -66,7 +48,7 @@ Feature: Profile a specific hook
6648
<meta name="generator"
6749
"""
6850

69-
@require-wp-4.0 @less-than-wp-6.9
51+
@less-than-wp-6.9
7052
Scenario: Profile the shutdown hook
7153
Given a WP install
7254
And a wp-content/mu-plugins/shutdown.php file:
@@ -108,7 +90,6 @@ Feature: Profile a specific hook
10890
| total (3) | 0 | 1 |
10991
And STDERR should be empty
11092

111-
@require-wp-4.0
11293
Scenario: Indicate where a callback is defined with profiling a hook
11394
Given a WP install
11495
And a wp-content/mu-plugins/custom-action.php file:
@@ -149,43 +130,3 @@ Feature: Profile a specific hook
149130
"""
150131
Warning: Called 1
151132
"""
152-
153-
@less-than-php-7 @require-wp-4.0
154-
Scenario: Profile the mu_plugins:before hook
155-
Given a WP install
156-
And a wp-content/mu-plugins/awesome-file.php file:
157-
"""
158-
<?php
159-
function awesome_func() {
160-
// does nothing
161-
}
162-
awesome_func();
163-
"""
164-
165-
When I run `wp profile hook muplugins_loaded:before --fields=callback`
166-
Then STDOUT should contain:
167-
"""
168-
wp-content/mu-plugins/awesome-file.php
169-
"""
170-
171-
@less-than-php-7 @require-wp-4.0
172-
Scenario: Profile the :after hooks
173-
Given a WP install
174-
175-
When I run `wp profile hook wp_loaded:after`
176-
Then STDOUT should contain:
177-
"""
178-
do_action()
179-
"""
180-
181-
When I run `wp profile hook wp:after`
182-
Then STDOUT should contain:
183-
"""
184-
do_action_ref_array()
185-
"""
186-
187-
When I run `wp profile hook wp_footer:after`
188-
Then STDOUT should contain:
189-
"""
190-
do_action()
191-
"""

features/profile-queries.feature

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Feature: Profile database queries
22

3-
@require-wp-4.0
43
Scenario: Show all database queries
54
Given a WP install
65
And a wp-content/mu-plugins/test-queries.php file:
@@ -36,7 +35,6 @@ Feature: Profile database queries
3635
"""
3736
And STDERR should be empty
3837

39-
@require-wp-4.0
4038
Scenario: Show queries with specific fields
4139
Given a WP install
4240

@@ -55,7 +53,6 @@ Feature: Profile database queries
5553
"""
5654
And STDERR should be empty
5755

58-
@require-wp-4.0
5956
Scenario: Order queries by execution time
6057
Given a WP install
6158

@@ -66,7 +63,6 @@ Feature: Profile database queries
6663
"""
6764
And STDERR should be empty
6865

69-
@require-wp-4.0
7066
Scenario: Display queries in JSON format
7167
Given a WP install
7268

@@ -81,7 +77,6 @@ Feature: Profile database queries
8177
"""
8278
And STDERR should be empty
8379

84-
@require-wp-4.0
8580
Scenario: Filter queries by hook
8681
Given a WP install
8782
And a wp-content/mu-plugins/query-test.php file:
@@ -100,7 +95,6 @@ Feature: Profile database queries
10095
"""
10196
And STDERR should be empty
10297

103-
@require-wp-4.0
10498
Scenario: Filter queries by callback
10599
Given a WP install
106100
And a wp-content/mu-plugins/callback-test.php file:

features/profile-stage.feature

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Feature: Profile the template render stage
22

3-
@require-wp-4.0
43
Scenario: Profiler loads a summary table
54
Given a WP install
65

@@ -11,7 +10,6 @@ Feature: Profile the template render stage
1110
| main_query |
1211
| template |
1312

14-
@require-wp-4.0
1513
Scenario: Profiler loads a table with the correct hooks
1614
Given a WP install
1715

@@ -81,7 +79,6 @@ Feature: Profile the template render stage
8179
| loop_end:before |
8280
| loop_end |
8381

84-
@require-wp-4.0
8582
Scenario: Use --all flag to profile all stages
8683
Given a WP install
8784

@@ -134,7 +131,6 @@ Feature: Profile the template render stage
134131
Error: Invalid stage. Must be one of bootstrap, main_query, template, or use --all.
135132
"""
136133

137-
@require-wp-4.0
138134
Scenario: Invalid field name supplied to --fields
139135
Given a WP install
140136

@@ -145,7 +141,6 @@ Feature: Profile the template render stage
145141
"""
146142
And the return code should be 1
147143

148-
@require-wp-4.0
149144
Scenario: Identify callback_count for each hook
150145
Given a WP install
151146

@@ -154,7 +149,6 @@ Feature: Profile the template render stage
154149
| hook | callback_count |
155150
| muplugins_loaded | 2 |
156151

157-
@require-wp-4.0
158152
Scenario: Use spotlight mode to filter out the zero-ish values
159153
Given a WP install
160154

features/profile.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Feature: Basic profile usage
3434
Error: 'SAVEQUERIES' is defined as false, and must be true. Please check your wp-config.php
3535
"""
3636
37-
@require-wp-4.0
3837
Scenario: Profile a hook without any callbacks
3938
Given a WP install
4039
@@ -44,7 +43,6 @@ Feature: Basic profile usage
4443
| total (0) | |
4544
And STDERR should be empty
4645
47-
@require-wp-4.0
4846
Scenario: Trailingslash provided URL to avoid canonical redirect
4947
Given a WP install
5048

0 commit comments

Comments
 (0)