OSDN Git Service

Adding feature tests for `theme enable` and `theme disable`
authorMatt Boynes <mboynes@alleyinteractive.com>
Fri, 27 Dec 2013 20:42:24 +0000 (15:42 -0500)
committerMatt Boynes <mboynes@alleyinteractive.com>
Fri, 27 Dec 2013 20:42:24 +0000 (15:42 -0500)
features/theme.feature

index f14a820..24c4237 100644 (file)
@@ -1,9 +1,8 @@
 Feature: Manage WordPress themes
 
-  Background:
+  Scenario: Installing and deleting theme
     Given a WP install
 
-  Scenario: Installing and deleting theme
     When I run `wp theme install p2`
     Then STDOUT should not be empty
 
@@ -52,6 +51,8 @@ Feature: Manage WordPress themes
     Then STDOUT should not be empty
 
   Scenario: Install a theme, activate, then force install an older version of the theme
+    Given a WP install
+
     When I run `wp theme install p2 --version=1.4.2`
     Then STDOUT should not be empty
 
@@ -72,6 +73,8 @@ Feature: Manage WordPress themes
       | p2    | active   | available | 1.4.1     |
 
   Scenario: Get the path of an installed theme
+    Given a WP install
+
     When I run `wp theme install p2`
     Then STDOUT should not be empty
 
@@ -80,3 +83,55 @@ Feature: Manage WordPress themes
        """
        wp-content/themes/p2
        """
+
+  Scenario: Enabling and disabling a theme
+       Given a WP multisite install
+
+    When I run `wp theme install p2`
+    Then STDOUT should not be empty
+
+    When I run `wp theme enable p2`
+    Then STDOUT should contain:
+       """
+       Success: Enabled the 'P2' theme.
+       """
+
+    When I run `wp theme disable p2`
+    Then STDOUT should contain:
+       """
+       Success: Disabled the 'P2' theme.
+       """
+
+    When I run `wp theme enable p2 --activate`
+    Then STDOUT should contain:
+       """
+       Success: Enabled the 'P2' theme.
+       Success: Switched to 'P2' theme.
+       """
+
+    When I run `wp theme enable p2 --network`
+    Then STDOUT should contain:
+       """
+       Success: Network enabled the 'P2' theme.
+       """
+
+    When I run `wp theme disable p2 --network`
+    Then STDOUT should contain:
+       """
+       Success: Network disabled the 'P2' theme.
+       """
+
+  Scenario: Enabling and disabling a theme without multisite
+       Given a WP install
+
+    When I try `wp theme enable p2`
+    Then STDERR should be:
+      """
+      Error: This is not a multisite install.
+      """
+
+    When I try `wp theme disable p2`
+    Then STDERR should be:
+      """
+      Error: This is not a multisite install.
+      """