forked from wp-cli/wp-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.feature
51 lines (45 loc) · 1.18 KB
/
runner.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Feature: Runner WP-CLI
Scenario: Path argument should be slashed correctly
When I try `wp no-such-command --path=/foo --debug`
Then STDERR should contain:
"""
ABSPATH defined: /foo/
"""
When I try `wp no-such-command --path=/foo/ --debug`
Then STDERR should contain:
"""
ABSPATH defined: /foo/
"""
When I try `wp no-such-command --path=/foo\\ --debug`
Then STDERR should contain:
"""
ABSPATH defined: /foo/
"""
Scenario: ABSPATH can be defined outside of WP-CLI
Given an empty directory
And a wp-cli.yml file:
"""
require:
- abspath.php
"""
And a abspath.php file:
"""
<?php
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', '/some_path/' );
}
"""
When I try `wp no-such-command --debug`
Then STDERR should not contain:
"""
Constant ABSPATH already defined in
"""
And STDERR should contain:
"""
ABSPATH defined: /some_path/
"""
When I try `wp no-such-command --path=/foo --debug`
Then STDERR should contain:
"""
The --path parameter cannot be used when ABSPATH is already defined elsewhere
"""