-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathcli-info.feature
More file actions
97 lines (81 loc) · 2.39 KB
/
cli-info.feature
File metadata and controls
97 lines (81 loc) · 2.39 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Feature: Review CLI information
Background:
When I run `wp package path`
Then save STDOUT as {PACKAGE_PATH}
Scenario: Get the path to the packages directory
Given an empty directory
And a non-existent {PACKAGE_PATH} directory
When I run `wp cli info --format=json`
Then STDOUT should be JSON containing:
"""
{"wp_cli_packages_dir_path":null}
"""
# Allow for composer/ca-bundle using `openssl_x509_parse()` which throws PHP warnings on old versions of PHP.
When I try `wp package install danielbachhuber/wp-cli-reset-post-date-command`
And I run `wp cli info --format=json`
Then STDOUT should be JSON containing:
"""
{"wp_cli_packages_dir_path":"{PACKAGE_PATH}"}
"""
When I run `wp cli info`
Then STDOUT should contain:
"""
WP-CLI packages dir:
"""
Scenario: Display memory limit
Given an empty directory
When I run `wp cli info`
Then STDOUT should contain:
"""
PHP memory limit:
"""
When I run `wp cli info --format=json`
Then STDOUT should contain:
"""
"php_memory_limit":
"""
Scenario: Warn about low memory limit
Given an empty directory
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=256M} cli info`
Then STDOUT should contain:
"""
PHP memory limit: 256M
"""
And STDERR should contain:
"""
PHP memory limit is set to 256M
"""
When I run `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=1G} cli info`
Then STDOUT should contain:
"""
PHP memory limit: 1G
"""
And STDERR should be empty
When I run `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=-1} cli info`
Then STDOUT should contain:
"""
PHP memory limit: -1
"""
And STDERR should be empty
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=512M} cli info`
Then STDOUT should contain:
"""
PHP memory limit: 512M
"""
And STDERR should be empty
Scenario: Packages directory path should be slashed correctly
When I run `WP_CLI_PACKAGES_DIR=/foo wp package path`
Then STDOUT should be:
"""
/foo/
"""
When I run `WP_CLI_PACKAGES_DIR=/foo/ wp package path`
Then STDOUT should be:
"""
/foo/
"""
When I run `WP_CLI_PACKAGES_DIR=/foo\\ wp package path`
Then STDOUT should be:
"""
/foo/
"""