Skip to content

Commit 9e5aa60

Browse files
Copilotswissspidy
andcommitted
Improve first test scenario to add custom queries
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 071cb94 commit 9e5aa60

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

features/profile-queries.feature

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,33 @@ Feature: Profile database queries
33
@require-wp-4.0
44
Scenario: Show all database queries
55
Given a WP install
6+
And a wp-content/mu-plugins/test-queries.php file:
7+
"""
8+
<?php
9+
add_action( 'init', function() {
10+
global $wpdb;
11+
$wpdb->query( "SELECT 1 as test_query_one" );
12+
$wpdb->query( "SELECT 2 as test_query_two" );
13+
});
14+
"""
615

7-
When I run `wp profile queries --fields=time`
16+
When I run `wp profile queries --fields=query,time`
817
Then STDOUT should contain:
18+
"""
19+
query
20+
"""
21+
And STDOUT should contain:
922
"""
1023
time
1124
"""
25+
And STDOUT should contain:
26+
"""
27+
SELECT 1 as test_query_one
28+
"""
29+
And STDOUT should contain:
30+
"""
31+
SELECT 2 as test_query_two
32+
"""
1233
And STDOUT should contain:
1334
"""
1435
total

0 commit comments

Comments
 (0)