Improve SQLite compatibility by swissspidy · Pull Request #431 · wp-cli/entity-command · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions features/comment.feature
25 changes: 24 additions & 1 deletion features/post.feature
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ Feature: Manage WordPress posts
2005-01-24 09:52:00
"""

@require-mysql
Scenario: Publishing a post and setting a date succeeds if the edit_date flag is passed.
Given a WP install

Expand All @@ -473,4 +474,26 @@ Feature: Manage WordPress posts
Then STDOUT should contain:
"""
2005-01-24 09:52:00
"""
"""

# Separate test because of a known bug in the SQLite plugin.
# See https://github.com/WordPress/sqlite-database-integration/issues/52.
# Once the bug is resolved, this separate test can be removed again.
@require-sqlite
Scenario: Publishing a post and setting a date succeeds if the edit_date flag is passed.
Given a WP install

When I run `wp post create --post_title='test' --porcelain`
Then save STDOUT as {POST_ID}

When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish' --edit_date=1`
Then STDOUT should contain:
"""
Success:
"""

When I run `wp post get {POST_ID} --field=post_date`
Then STDOUT should contain:
"""
2005-01-24T09:52:00.000Z
Comment thread
swissspidy marked this conversation as resolved.
"""
2 changes: 1 addition & 1 deletion features/site-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Create a new site on a WP multisite
define( 'BLOG_ID_CURRENT_SITE', 1 );
"""

When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < extra-config`
When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --extra-php < extra-config`
Then STDOUT should be:
"""
Success: Generated 'wp-config.php' file.
Expand Down
1 change: 1 addition & 0 deletions features/site-empty.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Feature: Empty a WordPress site of its data

@require-mysql
Scenario: Empty a site
Given a WP installation
And I run `wp option update uploads_use_yearmonth_folders 0`
Expand Down
1 change: 1 addition & 0 deletions features/site-option.feature
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Feature: Manage WordPress site options
"""
And the return code should be 1

@require-mysql
Scenario: Filter options by `--site_id`
Given a WP multisite installation

Expand Down
3 changes: 2 additions & 1 deletion features/user-application-password.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Feature: Manage user custom fields

@less-than-php-8.0
# SQLite requires WordPress 6.0+.
@less-than-php-8.0 @require-mysql
Scenario: User application passwords are disabled for WordPress lower than 5.6
Given a WP install
And I try `wp theme install twentytwenty --activate`
Expand Down
18 changes: 9 additions & 9 deletions src/Site_Command.php