-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathtesting.feature
More file actions
135 lines (112 loc) · 3.13 KB
/
testing.feature
File metadata and controls
135 lines (112 loc) · 3.13 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Feature: Test that WP-CLI loads.
Scenario: WP-CLI loads for your tests
Given a WP install
When I run `wp eval 'echo "Hello world.";'`
Then STDOUT should contain:
"""
Hello world.
"""
Scenario: WP Cron is disabled by default
Given a WP install
And the wp-config.php file should contain:
"""
if ( defined( 'DISABLE_WP_CRON' ) === false ) { define( 'DISABLE_WP_CRON', true ); }
"""
And a test_cron.php file:
"""
<?php
$cron_disabled = defined( "DISABLE_WP_CRON" ) ? DISABLE_WP_CRON : false;
echo 'DISABLE_WP_CRON is: ' . ( $cron_disabled ? 'true' : 'false' );
"""
When I run `wp eval-file test_cron.php`
Then STDOUT should be:
"""
DISABLE_WP_CRON is: true
"""
@require-sqlite
Scenario: Uses SQLite
Given a WP install
When I run `wp eval 'echo DB_ENGINE;'`
Then STDOUT should contain:
"""
sqlite
"""
@require-mysql
Scenario: Uses MySQL
Given a WP install
When I run `wp eval 'var_export( defined("DB_ENGINE") );'`
Then STDOUT should be:
"""
false
"""
@require-object-cache
Scenario: Uses Object Cache
Given a WP install
When I run `wp eval 'var_export( wp_using_ext_object_cache() );'`
Then STDOUT should be:
"""
true
"""
@require-sqlite
Scenario: Custom wp-content directory
Given a WP install
And a custom wp-content directory
When I run `wp eval 'echo DB_ENGINE;'`
Then STDOUT should contain:
"""
sqlite
"""
# Skipped on Windows because of curl getaddrinfo() errors.
@require-sqlite @skip-windows
Scenario: Composer installation
Given a WP install with Composer
When I run `wp eval 'echo DB_ENGINE;'`
Then STDOUT should contain:
"""
sqlite
"""
Scenario: WP installation with specific version
Given a WP 6.4.2 installation
When I run `wp core version`
Then STDOUT should be:
"""
6.4.2
"""
Scenario: WP installation in subdirectory with specific version
Given a WP 6.3.1 installation in 'wordpress'
When I run `wp core version --path=wordpress`
Then STDOUT should be:
"""
6.3.1
"""
@skip-mysql
Scenario: Skip on MySQL databases
Given a WP install
When I run `wp eval 'echo "This should only run on MariaDB or SQLite";'`
Then STDOUT should contain:
"""
This should only run on MariaDB or SQLite
"""
@skip-mariadb
Scenario: Skip on MariaDB databases
Given a WP install
When I run `wp eval 'echo "This should only run on MySQL or SQLite";'`
Then STDOUT should contain:
"""
This should only run on MySQL or SQLite
"""
@skip-sqlite
Scenario: Skip on SQLite databases
Given a WP install
When I run `wp eval 'echo "This should only run on MySQL or MariaDB";'`
Then STDOUT should contain:
"""
This should only run on MySQL or MariaDB
"""
Scenario: Verify sys_get_temp_dir() in sub-process
Given a WP install
When I run `wp eval 'echo sys_get_temp_dir();'`
Then STDOUT should not contain:
"""
C:\Windows
"""