-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathcore-version.feature
More file actions
109 lines (92 loc) · 3.22 KB
/
core-version.feature
File metadata and controls
109 lines (92 loc) · 3.22 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
Feature: Find version for WordPress install
Scenario: Verify core version
Given a WP install
And I run `wp core download --version=4.4.2 --force`
When I run `wp core version`
Then STDOUT should be:
"""
4.4.2
"""
When I run `wp core version --extra`
Then STDOUT should be:
"""
WordPress version: 4.4.2
Database revision: 35700
TinyMCE version: 4.208 (4208-20151113)
Package language: en_US
"""
Scenario: Installing WordPress for a non-default locale and verify core extended version information.
Given an empty directory
And an empty cache
When I run `wp core download --version=4.4.2 --locale=de_DE`
Then STDOUT should contain:
"""
Success: WordPress downloaded.
"""
When I run `wp core version --extra`
Then STDOUT should be:
"""
WordPress version: 4.4.2
Database revision: 35700
TinyMCE version: 4.208 (4208-20151113)
Package language: de_DE
"""
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
@require-mysql
Scenario: Verify actual database version shows correct values
Given a WP install
And I run `wp core download --version=6.6 --force`
And I run `wp option update db_version 45805`
# Without --actual, should show expected version from version.php
When I run `wp core version --extra`
Then STDOUT should contain:
"""
Database revision: 57155
"""
# With --actual, should show actual database version
When I run `wp core version --extra --actual`
Then STDOUT should contain:
"""
Database revision: 45805
"""
# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
@require-mysql
Scenario: Verify actual database version in multisite subsite
Given a WP multisite install
And I run `wp core download --version=6.6 --force`
And I run `wp option update db_version 57155`
And I run `wp site create --slug=subsite --porcelain`
And save STDOUT as {SUBSITE_ID}
And I run `wp option update db_version 45805 --url=example.com/subsite`
# Main site shows expected version from version.php without --actual
When I run `wp core version --extra`
Then STDOUT should contain:
"""
Database revision: 57155
"""
# Main site shows actual database version with --actual
When I run `wp core version --extra --actual`
Then STDOUT should contain:
"""
Database revision: 57155
"""
# Subsite shows expected version from version.php without --actual
When I run `wp core version --extra --url=example.com/subsite`
Then STDOUT should contain:
"""
Database revision: 57155
"""
# Subsite shows its own actual database version with --actual
When I run `wp core version --extra --actual --url=example.com/subsite`
Then STDOUT should contain:
"""
Database revision: 45805
"""
Scenario: Error when using --actual without --extra
Given a WP install
When I try `wp core version --actual`
Then STDERR should contain:
"""
Error: The --actual flag can only be used with --extra.
"""
And the return code should be 1