2016-08-30 05:15:13 -07:00
|
|
|
Feature: Basic profile usage
|
|
|
|
|
|
|
|
Scenario: Error when SAVEQUERIES is defined to false
|
|
|
|
Given an empty directory
|
|
|
|
And WP files
|
|
|
|
And a database
|
|
|
|
And a extra-php file:
|
|
|
|
"""
|
|
|
|
define( 'SAVEQUERIES', false );
|
|
|
|
"""
|
|
|
|
And I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < extra-php`
|
|
|
|
|
|
|
|
When I run `wp core install --url='https://localhost' --title='Test' --admin_user=wpcli --admin_email=admin@example.com --admin_password=1`
|
|
|
|
Then the return code should be 0
|
|
|
|
|
2016-10-04 06:47:01 -07:00
|
|
|
When I try `wp profile stage`
|
2016-08-30 05:15:13 -07:00
|
|
|
Then STDERR should be:
|
|
|
|
"""
|
|
|
|
Error: 'SAVEQUERIES' is defined as false, and must be true. Please check your wp-config.php
|
|
|
|
"""
|
2016-09-08 06:15:10 -07:00
|
|
|
|
|
|
|
Scenario: Profile a hook without any callbacks
|
|
|
|
Given a WP install
|
|
|
|
|
2016-10-04 06:47:01 -07:00
|
|
|
When I run `wp profile hook setup_theme --fields=callback,time`
|
2016-09-08 06:15:10 -07:00
|
|
|
Then STDOUT should be a table containing rows:
|
|
|
|
| callback | time |
|
|
|
|
| total | |
|
|
|
|
And STDERR should be empty
|
2016-10-04 07:17:24 -07:00
|
|
|
|
|
|
|
Scenario: Trailingslash provided URL to avoid canonical redirect
|
|
|
|
Given a WP install
|
|
|
|
|
2016-10-04 07:27:31 -07:00
|
|
|
When I run `wp profile hook setup_theme --url=example.com --fields=callback,time`
|
2016-10-04 07:17:24 -07:00
|
|
|
Then STDERR should be empty
|
|
|
|
And STDOUT should be a table containing rows:
|
|
|
|
| callback | time |
|
|
|
|
| total | |
|