Closed tfirdaus closed 7 months ago
In Given
, if we could provide like
And I run `wp theme delete --all --force`
then we need not have to update much of code. This way we only need to replace theme slug in When
.
I tried using the --force
flag, but it seems like it's going to require more updates to the initial feature spec than the necessary. Here's an example where it didn't work as expected. Since the twentytwenty
theme is already installed, if I use --force
, I'll have to change the output message from "Theme installed successfully." to "Theme updated successfully."
@ernilambar @swissspidy Thought on this. Do you think this is the preferable approach? Ideally I'd prefer to keep the updates to a minimum.
I think you added --force
to the command in When
. We should not be updating those arguments. You can add And I run wp theme delete --all --force
in Given (after line 4) in theme-install.feature
. (Apologies. I think I didn't make that clear in earlier comment)
There are still a lot of tests referencing p2
. I'd probably start by replacing all of those with twentytwelve
@ernilambar this error is a bit weird to me. Somehow it does not happen when I run this test in local. What do you think I did wrong here? It seems there are slight differences between the environment that missed in my local.
009 Scenario: Parent theme is active when its child is active # features/theme.feature:577
And I run `wp theme delete twentytwelve --force` # features/theme.feature:579
$ wp theme delete twentytwelve --force
Success: Theme already deleted.
If I did not run wp theme delete twentytwelve --force
, it would throw:
001 Scenario: Parent theme is active when its child is active # features/theme.feature:577
And I run `wp theme install twentytwelve` # features/theme.feature:580
$ wp theme install twentytwelve
Success: Theme already installed.
Warning: twentytwelve: Theme already installed.
Thanks @ernilambar for your help on this PR 👏
This Pull Request updates the theme to install in the feature tests from
p2
totwentytwelve
since thep2
has been removed from WP.org repository.Reference