OSDN Git Service

Added CPT and TAX --flags test and TAX --theme test
authorjmslbam <jmslbam@gmail.com>
Mon, 22 Apr 2013 22:50:10 +0000 (00:50 +0200)
committerscribu <mail@scribu.net>
Fri, 10 May 2013 21:42:01 +0000 (00:42 +0300)
features/scaffold.feature

index 5c966f0..616ebfa 100644 (file)
@@ -1,15 +1,64 @@
 Feature: Wordpress code scaffolding
-  
-  Scenario: Scaffold a Custom Post Type
-      Given a WP install
 
-      When I run `wp scaffold post-type zombie`
-      Then it should run without errors
-      And STDOUT should contain:
+  Scenario: Scaffold a Custom Taxonomy and write it to active theme
+    Given a WP install
+
+    When I run `wp scaffold taxonomy zombie-speed --theme`
+    Then it should run without errors
+
+    When I run `wp option get stylesheet`
+    Then it should run without errors
+    And save STDOUT as {ACTIVE_THEME}
+
+    #And the wp-content/{ACTIVE_THEME}/taxonomy/zombie-speed.php file should exist
+    And the wp-content/themes/twentytwelve/taxonomies/zombie-speed.php file should exist
+
+  # Test for all flags but --label, --theme, --plugin and --raw
+  Scenario: Scaffold a Custom Taxonomy and attach it to a CPT zombie that is prefixed and has a text domain
+    Given a WP install
+
+    When I run `wp scaffold taxonomy zombie-speed --post_types="prefix-zombie" --textdomain=zombieland`
+    Then it should run without errors
+    And STDOUT should contain:
+      """
+      __( 'Zombie speeds'
+      """
+    And STDOUT should contain:
+      """
+      array( 'prefix-zombie' )
+      """
+    And STDOUT should contain:
+      """
+      __( 'Zombie speeds', 'zombieland'
+      """
+
+  Scenario: Scaffold a Custom Taxonomy with label "Speed"
+    Given a WP install
+
+    When I run `wp scaffold taxonomy zombie-speed --label="Speed"`
+    Then it should run without errors
+    And STDOUT should contain:
         """
-        __( 'Zombies'
+        __( 'Speed'
         """
-          
+
+
+
+  # Test for all flags but --label, --theme, --plugin and --raw
+  Scenario: Scaffold a Custom Post Type
+    Given a WP install
+
+    When I run `wp scaffold post-type zombie --textdomain=zombieland`
+    Then it should run without errors
+    And STDOUT should contain:
+      """
+      __( 'Zombies'
+      """
+    And STDOUT should contain:
+      """
+      __( 'Zombies', 'zombieland'
+      """
+
   Scenario: Scaffold a Custom Post Type with label
     Given a WP install