{"id":1453,"date":"2022-10-04T11:59:06","date_gmt":"2022-10-04T04:59:06","guid":{"rendered":"https:\/\/gresik.wordcamp.org\/2022\/?post_type=wcb_session&#038;p=1453"},"modified":"2022-11-07T22:21:01","modified_gmt":"2022-11-07T15:21:01","slug":"spinning-up-a-woocommerce-testing-environment-in-seconds-using-a-custom-wp-cli-command","status":"publish","type":"wcb_session","link":"https:\/\/gresik.wordcamp.org\/2022\/session\/spinning-up-a-woocommerce-testing-environment-in-seconds-using-a-custom-wp-cli-command\/","title":{"rendered":"Spinning Up a WooCommerce Testing Environment In Seconds Using a Custom WP-CLI Command"},"content":{"rendered":"\n<p><strong>Speaker Type:<\/strong> International<\/p>\n\n\n\n<p><strong>Topic Description:<\/strong> Creating a WooCommerce plugin is fun, but spinning up a WooCommerce testing environment isn\u2019t! At least not, if you need to set it up manually. Setting up the WooCommerce testing environment manually requires the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creating a WordPress site.<\/li>\n\n\n\n<li>Installing and activating the WooCommerce plugin.<\/li>\n\n\n\n<li>Installing and activating the WooCommerce Blocks plugin.<\/li>\n\n\n\n<li>Installing and activating the Gutenberg plugin.<\/li>\n\n\n\n<li>Installing and activating the Stripe plugin.<\/li>\n\n\n\n<li>Installing and activating the Storefront theme.<\/li>\n\n\n\n<li>Importing sample products.<\/li>\n\n\n\n<li>Setting up payment methods.<\/li>\n\n\n\n<li>Setting up shipping methods.<\/li>\n\n\n\n<li>Setting up tax settings.<\/li>\n\n\n\n<li>Setting up coupons.<\/li>\n\n\n\n<li>Setting up the WooCommerce Blocks pages.<\/li>\n\n\n\n<li>Setting up the menu.<\/li>\n<\/ul>\n\n\n\n<p>What if you could run one command that takes care of all these steps? Imagine you could spin up a WordPress site, create an SSH connection to that site and simply run the following command:&nbsp;<code>wp package install git@github.com:nielslange\/woo-test-environment.git &amp;&amp; wp woo-test-environment setup --blocks --gutenberg --stripe --theme=storefront<\/code>&nbsp;This single command then executes all the steps I mentioned before.<\/p>\n\n\n\n<p>Within a few seconds, you\u2019ll then have a complete WooCommerce testing environment! And if you run that command 100 times, you\u2019ll have 100 identical testing sites. Now, how does that sound?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Speaker Type: International Topic Description: Creating a WooCommerce plugin is fun, but spinning up a WooCommerce testing environment isn\u2019t! At least not, if you need to set it up manually. Setting up the WooCommerce testing environment manually requires the following &hellip; <a href=\"https:\/\/gresik.wordcamp.org\/2022\/session\/spinning-up-a-woocommerce-testing-environment-in-seconds-using-a-custom-wp-cli-command\/\">Continue reading <span class=\"assistive-text\">Spinning Up a WooCommerce Testing Environment In Seconds Using a Custom WP-CLI Command<\/span>  <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":14617105,"featured_media":0,"template":"","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_wcpt_session_time":1667971200,"_wcpt_session_duration":3000,"_wcpt_session_type":"session","_wcpt_session_slides":"","_wcpt_session_video":"","_wcpt_speaker_id":[1206],"footnotes":""},"session_track":[1079863],"session_category":[1079885,1079887],"class_list":["post-1453","wcb_session","type-wcb_session","status-publish","hentry","wcb_track-track-2","wcb_session_category-english","wcb_session_category-technical"],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"session_date_time":{"date":"9 November 2022","time":"12:20"},"session_speakers":[{"id":"1206","slug":"niels-lange","name":"Niels Lange","link":"https:\/\/gresik.wordcamp.org\/2022\/speaker\/niels-lange\/"}],"session_cats_rendered":"English, Technical","_links":{"self":[{"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/sessions\/1453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/sessions"}],"about":[{"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/types\/wcb_session"}],"version-history":[{"count":7,"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/sessions\/1453\/revisions"}],"predecessor-version":[{"id":1831,"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/sessions\/1453\/revisions\/1831"}],"speakers":[{"embeddable":true,"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/speakers\/1206"}],"author":[{"embeddable":true,"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wporg\/v1\/users\/nielslange"}],"wp:attachment":[{"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/media?parent=1453"}],"wp:term":[{"taxonomy":"wcb_track","embeddable":true,"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/session_track?post=1453"},{"taxonomy":"wcb_session_category","embeddable":true,"href":"https:\/\/gresik.wordcamp.org\/2022\/wp-json\/wp\/v2\/session_category?post=1453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}