From 5ad115079538d63bb17c9d6f248821265df61bd9 Mon Sep 17 00:00:00 2001 From: jmslbam Date: Tue, 23 Apr 2013 00:50:10 +0200 Subject: [PATCH] Added CPT and TAX --flags test and TAX --theme test --- features/scaffold.feature | 65 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/features/scaffold.feature b/features/scaffold.feature index 5c966f08..616ebfad 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -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 -- 2.11.0