{"id":5078,"date":"2018-03-23T01:18:31","date_gmt":"2018-03-23T00:18:31","guid":{"rendered":"https:\/\/2018.europe.wordcamp.org\/?post_type=wcb_session&#038;p=5078"},"modified":"2018-06-25T13:07:22","modified_gmt":"2018-06-25T12:07:22","slug":"an-introduction-to-unit-testing-for-wordpress","status":"publish","type":"wcb_session","link":"https:\/\/europe.wordcamp.org\/2018\/session\/an-introduction-to-unit-testing-for-wordpress\/","title":{"rendered":"An Introduction to Unit Testing (for WordPress)"},"content":{"rendered":"<p>We&#8217;ve all had these &#8220;Wait, what? That worked the other day!&#8221; moments. They usually happen after we introduced a new feature but broke existing functionality in the process. This is why we often don&#8217;t feel confident that our code is working as expected. When developing plugins\u2014or whole websites\u2014this is important, though. Clients expect that making changes won&#8217;t break their sites. But can we be sure of that?<\/p>\n<p>There is a solution for that, and it\u2019s called Unit Testing! During this hands-on workshop, we&#8217;ll help you understand what testable code is and how to write unit tests for it. Armed with this knowledge, you&#8217;ll be able to prevent these embarrassing moments from ever happening again.<\/p>\n<p>&nbsp;<\/p>\n<h2>Required skill set<\/h2>\n<p>It is a development-specific workshop, so you should have an idea about coding in general. Besides that, the workshop itself does not require any specific skill or knowledge.<\/p>\n<h2>Technical requirement<\/h2>\n<p>You should have PHP and (or) <a href=\"https:\/\/nodejs.org\/en\/download\/\">Node.js installed<\/a>, either locally or in a virtual machine. You dont&#8217;t need a complete server stack (i.e., no webserver, or database server). If you want to use a specific testing tool\/framework (and not the ones that we will be using) you should have them set up already.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve all had these &#8220;Wait, what? That worked the other day!&#8221; moments. They usually happen after we introduced a new feature but broke existing functionality in the process. This is why we often don&#8217;t feel confident that our code is working as expected. When developing plugins\u2014or whole websites\u2014this is important, though. Clients expect that making [&hellip;]<\/p>\n","protected":false},"author":14599396,"featured_media":0,"template":"","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_wcpt_session_time":1529053200,"_wcpt_session_duration":3000,"_wcpt_session_type":"session","_wcpt_session_slides":"https:\/\/slides.tfrommen.de\/wceu-2018-unit-testing\/#\/","_wcpt_session_video":"","_wcpt_speaker_id":[4869,4834,4832],"footnotes":""},"session_track":[919799],"session_category":[1242643],"class_list":["post-5078","wcb_session","type-wcb_session","status-publish","hentry","wcb_track-workshop-2","wcb_session_category-workshop-3h"],"jetpack_shortlink":"https:\/\/wp.me\/p8QI2W-1jU","jetpack_sharing_enabled":true,"session_date_time":{"date":"June 15, 2018","time":"10:00"},"session_speakers":[{"id":"4869","slug":"thorsten-frommen","name":"Thorsten Frommen","link":"https:\/\/europe.wordcamp.org\/2018\/speaker\/thorsten-frommen\/"},{"id":"4834","slug":"carl-alexander","name":"Carl Alexander","link":"https:\/\/europe.wordcamp.org\/2018\/speaker\/carl-alexander\/"},{"id":"4832","slug":"giuseppe-mazzapica","name":"Giuseppe Mazzapica","link":"https:\/\/europe.wordcamp.org\/2018\/speaker\/giuseppe-mazzapica\/"}],"session_cats_rendered":"Workshop 3h","_links":{"self":[{"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/sessions\/5078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/sessions"}],"about":[{"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/types\/wcb_session"}],"version-history":[{"count":3,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/sessions\/5078\/revisions"}],"predecessor-version":[{"id":9077,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/sessions\/5078\/revisions\/9077"}],"speakers":[{"embeddable":true,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/speakers\/4869"},{"embeddable":true,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/speakers\/4834"},{"embeddable":true,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/speakers\/4832"}],"author":[{"embeddable":true,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wporg\/v1\/users\/tfrommen"}],"wp:attachment":[{"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/media?parent=5078"}],"wp:term":[{"taxonomy":"wcb_track","embeddable":true,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/session_track?post=5078"},{"taxonomy":"wcb_session_category","embeddable":true,"href":"https:\/\/europe.wordcamp.org\/2018\/wp-json\/wp\/v2\/session_category?post=5078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}