{"id":8800,"date":"2014-08-07T00:27:02","date_gmt":"2014-08-07T04:27:02","guid":{"rendered":"http:\/\/webdevstudios.com\/?p=8357"},"modified":"2024-04-15T12:05:42","modified_gmt":"2024-04-15T16:05:42","slug":"unit-testing-your-plugins","status":"publish","type":"post","link":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/","title":{"rendered":"Unit Testing Your Plugins"},"content":{"rendered":"<p>So you have an amazing plugin, and it&#8217;s starting to get bigger and the bug reports are piling up (or better you are are starting a new plugin and you wanna do it right). Unfortunately getting PHPUnit to properly function with WordPress is a task that requires some serious configuration. Fortunately WP-CLI includes an automated method for getting started with tests in your plugin!<\/p>\n<p>Using WP-CLI&#8217;s scaffold command we can automatically generate the files necessary to start testing our plugin. The most difficult portion of this process is getting everything installed properly. If you are using <a href=\"https:\/\/github.com\/Varying-Vagrant-Vagrants\/VVV\" target=\"_blank\" rel=\"noopener\">Varying Vagrant Vagrants<\/a>\u00a0which I highly recommend with <a href=\"https:\/\/github.com\/aliso\/vvv-site-wizard\" target=\"_blank\" rel=\"noopener\">Alison Barret&#8217;s Site Wizard<\/a>\u00a0you already have everything you need installed and you can just &#8216;vagrant ssh&#8217; in and skip down to the \u201cSetup the Plugin\u201d section.<\/p>\n<h2>Installation<\/h2>\n<p>Install PHPUnit\u00a0here <a href=\"http:\/\/phpunit.de\/getting-started.html\" target=\"_blank\" rel=\"noopener\">http:\/\/phpunit.de\/getting-started.html<\/a><\/p>\n<p>Install WP-CLI here <a href=\"http:\/\/wp-cli.org\/\">http:\/\/wp-cli.org\/<\/a><\/p>\n<h2>Setup the Plugin<\/h2>\n<p>Once you have everything installed and working properly it&#8217;s just a matter of running a few cli commands.<!--more--><\/p>\n<div class=\"snippetcpt-wrap\" id=\"snippet-9368\" data-id=\"9368\" data-edit=\"\" data-copy=\"\/wp-json\/wp\/v2\/posts\/8800?snippet=51f517d8f2&#038;id=9368\" data-fullscreen=\"https:\/\/webdevstudios.com\/code-snippets\/setup-plugin-tests\/?full-screen=1\">\n\t\t\t\t<pre class=\"prettyprint linenums lang-bsh\" title=\"Unit Testing Your Plugins 1 - Setup Plugin Tests\">wp scaffold plugin-tests plugin-name\n# replacing plugin-name with the folder name of your plugin\n\n# then move to the plugin directory if you aren't there already\ncd wp-content\/plugins\/plugin-name\n\n.\/bin\/install-wp-tests.sh wordpress_test mysql_username 'mysql_password' localhost latest\n# Replace mysql_username, mysql_password, and localhost with \n# the proper login credentials for your local database.\n\n# Once those command have been run you can run\nphpunit\n# Which should give you a single successful test<\/pre>\n\t\t\t<\/div>\n<h2>Writing Tests<\/h2>\n<p>The wp-cli scaffold command created a few new files in the plugin folder, the most important being the tests folder. PHPUnit\u00a0will run any tests you place in the tests folder. Included is a file called <strong>test-sample.php<\/strong> in this file you can find a basic example of a WordPress PHPUnit\u00a0test.<\/p>\n<div class=\"snippetcpt-wrap\" id=\"snippet-9369\" data-id=\"9369\" data-edit=\"\" data-copy=\"\/wp-json\/wp\/v2\/posts\/8800?snippet=51f517d8f2&#038;id=9369\" data-fullscreen=\"https:\/\/webdevstudios.com\/code-snippets\/unit-testing-your-plugins-2-sampletest\/?full-screen=1\">\n\t\t\t\t<pre class=\"prettyprint linenums lang-php\" title=\"Unit Testing Your Plugins 2 - SampleTest\">class SampleTest extends WP_UnitTestCase {\n  function testSample() {\n    \/\/ replace this with some actual testing code\n    $this-&gt;assertTrue( true );\n  }\n}<\/pre>\n\t\t\t<\/div>\n<p>In every test&#8217;s file you create, setup your test\u00a0by wrapping them in classes that <em>extend<\/em> <em>WP_UnitTestCase<\/em>. Every function in the <em>WP_UnitTestCase<\/em> class that begins with <em>test<\/em> will run automatically.<\/p>\n<p>Unit testing relies on assertions to confirm that the behavior your plugin is exhibiting matches the behavior that is expected. In the example above the simple testSample asserts that true is true which should always come out positive unless something is seriously wrong.<\/p>\n<p>Let&#8217;s say we have a plugin that keeps track of a score for posts using post meta, let&#8217;s write a few tests to confirm the basic behavior of the plugin.<\/p>\n<div class=\"snippetcpt-wrap\" id=\"snippet-9370\" data-id=\"9370\" data-edit=\"\" data-copy=\"\/wp-json\/wp\/v2\/posts\/8800?snippet=51f517d8f2&#038;id=9370\" data-fullscreen=\"https:\/\/webdevstudios.com\/code-snippets\/unit-testing-your-plugins-3-scoretest\/?full-screen=1\">\n\t\t\t\t<pre class=\"prettyprint linenums lang-php\" title=\"Unit Testing Your Plugins 3 - ScoreTest\">class ScoreTest extends WP_UnitTestCase {\n  function testInitialScore() {\n    \/\/ Create a new post\n    $post_id = $this-&gt;factory-&gt;post-&gt;create();\n    \/\/ Get the new posts score\n    $score = my_plugin_get_post_score( $post_id );\n    \/\/ Check to confirm the new post&rsquo;s score is equal to zero\n    $this-&gt;assertEquals( $score, 0 );\n  }\n\n  function testIncrementScore() {\n    \/\/ Create a new post\n    $post_id = $this-&gt;factory-&gt;post-&gt;create();\n    \/\/ Increment the posts scores\n    my_plugin_increment_post_score( $post_id );\n    \/\/ Get the posts score after incrementing\n    $score = my_plugin_get_post_score( $post_id );\n    \/\/ The posts score should now be 1\n    \/\/ it started at 0 and the increment method\n    \/\/ increase the score by 1.\n    $this-&gt;assertEquals( $score, 1 );\n    \/\/ Increment the score again, this time by 2\n    my_plugin_increment_post_score( $post_id, 2 );\n    \/\/ Get the new score\n    $score = my_plugin_get_post_score( $post_id );\n    \/\/ Confirm that 2 more points were added to the\n    \/\/ post score.\n    $this-&gt;assertEquals( $score, 3 );\n  }\n\n  function testResetScore() {\n    \/\/ Create a new post\n    $post_id = $this-&gt;factory-&gt;post-&gt;create();\n    \/\/ Add 5 points to the post\n    my_plugin_increment_post_score( $post_id, 5 );\n    \/\/ Reset the post&rsquo;s score to 0\n    my_plugin_reset_post_score( $post_id );\n    \/\/ Get the post&rsquo;s score\n    $score = my_plugin_get_post_score( $post_id );\n    \/\/ The post&rsquo;s score should be 0 because it was reset\n    $this-&gt;assertEquals( $score, 0 );\n  }\n}<\/pre>\n\t\t\t<\/div>\n<p>These three functions test different aspects of the post-scoring plugin\u2019s functionality. <em>testInitialScore<\/em> creates a new post and confirms that on create the <em>my_plugin_get_post_score<\/em> function returns 0.<\/p>\n<p>The <em>testIncrementScore<\/em> function confirms that the <em>my_plugin_increment_post_score<\/em> function properly increments the score by 1 &#8212; the default &#8212; or by a specified amount.<\/p>\n<p>The <em>testResetScore<\/em> creates a post, gives it several points, resets its score, and confirms that the <em>my_plugin_reset_post_score<\/em> function properly returned the post\u2019s score to 0.<\/p>\n<p>With these tests in place we can easily confirm whether or not the plugin is functioning\u00a0as it should, and\u00a0if any changes we make to the plugin break any required functionality.<\/p>\n<p>One important thing to notice in the above code is the use of <em>$this-&gt;factory<\/em> to create objects to work with. The <em>WP_UnitTestCase<\/em> class give us these methods to make it easier to test the interaction of WordPress and your plugin by giving you test data. For more information, <a href=\"http:\/\/codesymphony.co\/writing-wordpress-plugin-unit-tests\/#object-factories\" target=\"_blank\" rel=\"noopener\">this is a pretty nice rundown of functionality available through the factories<\/a>.<\/p>\n<p>Writing tests for complex functionality can be difficult, both in that the result of the function may be more difficult to confirm, and there is more space for edge cases that break in unexpected ways. If you are running into issues like these, consider breaking down large functions into smaller functions that only do one thing each\u00a0so\u00a0that they are simpler to test.<\/p>\n<p>In addition, you can integrate writing tests as part of your bug fixing\u00a0procedure. When a new bug is reported that isn&#8217;t covered by a test, write a new test that covers it so you are protected in\u00a0the future.<\/p>\n<h2>Automation!<\/h2>\n<p>Once you\u2019ve got PHPUnit\u00a0up and running and have some tasks in place you can do some really cool automation. Using a task runner like gulp or grunt, you can automatically run the tests whenever a php file is saved, or even before you are allowed to do a git commit.<\/p>\n<p><a href=\"https:\/\/www.npmjs.org\/package\/grunt-phpunit\" target=\"_blank\" rel=\"noopener\">Grunt PHPUnit\u00a0task<\/a><\/p>\n<p><a href=\"https:\/\/www.npmjs.org\/package\/gulp-phpunit\" target=\"_blank\" rel=\"noopener\">Gulp PHPUnit\u00a0task<\/a><\/p>\n<h2>Further Reading<\/h2>\n<p>This is just a basic introduction to using PHPUnit and WordPress. For further reading on more assert methods and use of PHPUnit check out the <a href=\"http:\/\/phpunit.de\/manual\/current\/en\/index.html\" target=\"_blank\" rel=\"noopener\">official documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you have an amazing plugin, and it&#8217;s starting to get bigger and the bug reports are piling up (or better you are are starting a new plugin and you wanna do it right). Unfortunately getting PHPUnit to properly function with WordPress is a task that requires some serious configuration. Fortunately WP-CLI includes an automated <a class=\"more-link\" href=\"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/\">Read More<span class=\"screen-reader-text\"> Unit Testing Your Plugins<\/span><\/a><\/p>\n","protected":false},"author":46,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[140,259,185,150,159],"tags":[192,7,366],"coauthors":[13429],"class_list":["post-8800","post","type-post","status-publish","format-standard","hentry","category-development","category-plugins","category-products-we-love","category-tutorial","category-workflow-tools","tag-development-tips","tag-plugin-development","tag-unit-testing"],"acf":{"blog_hero_image":null},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Unit Testing Your WordPress Plugins - WebDevStudios.com<\/title>\n<meta name=\"description\" content=\"So you have an amazing plugin &amp; it&#039;s starting to get bigger and the bug reports are piling up. Set up automated unit testing for your plugin &amp; save the day!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unit Testing Your Plugins\" \/>\n<meta property=\"og:description\" content=\"So you have an amazing plugin &amp; it&#039;s starting to get bigger and the bug reports are piling up. Set up automated unit testing for your plugin &amp; save the day!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/\" \/>\n<meta property=\"og:site_name\" content=\"WebDevStudios\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/webdevstudios\" \/>\n<meta property=\"article:published_time\" content=\"2014-08-07T04:27:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-15T16:05:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webdevstudios.com\/wp-content\/uploads\/2022\/11\/wds-default.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Camden Segal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webdevstudios\" \/>\n<meta name=\"twitter:site\" content=\"@webdevstudios\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Camden Segal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/\"},\"author\":{\"name\":\"Camden Segal\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/person\\\/82ed512295976e49907010f3490989c2\"},\"headline\":\"Unit Testing Your Plugins\",\"datePublished\":\"2014-08-07T04:27:02+00:00\",\"dateModified\":\"2024-04-15T16:05:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/\"},\"wordCount\":727,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#organization\"},\"keywords\":[\"development tips\",\"plugin development\",\"unit testing\"],\"articleSection\":[\"Development\",\"Plugins\",\"Products We Love\",\"Tutorial\",\"Workflow &amp; Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/\",\"name\":\"Unit Testing Your WordPress Plugins - WebDevStudios.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#website\"},\"datePublished\":\"2014-08-07T04:27:02+00:00\",\"dateModified\":\"2024-04-15T16:05:42+00:00\",\"description\":\"So you have an amazing plugin & it's starting to get bigger and the bug reports are piling up. Set up automated unit testing for your plugin & save the day!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/2014\\\/08\\\/07\\\/unit-testing-your-plugins\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/webdevstudios.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unit Testing Your Plugins\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#website\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/\",\"name\":\"WebDevStudios\",\"description\":\"WordPress Design and Development Agency\",\"publisher\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/webdevstudios.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#organization\",\"name\":\"WebDevStudios\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/wds-amp-logo.png\",\"contentUrl\":\"https:\\\/\\\/webdevstudios.com\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/wds-amp-logo.png\",\"width\":173,\"height\":60,\"caption\":\"WebDevStudios\"},\"image\":{\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/facebook.com\\\/webdevstudios\",\"https:\\\/\\\/x.com\\\/webdevstudios\",\"http:\\\/\\\/instagram.com\\\/webdevstudios\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/webdevstudios-llc-\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/webdevstudios.com\\\/#\\\/schema\\\/person\\\/82ed512295976e49907010f3490989c2\",\"name\":\"Camden Segal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b061c568ad94847a4b510bf61fea026ebfa04e4da98f5e3229f11fd2c53b48e7?s=96&d=mm&r=g4d2650ff7fd93cb54809dd154b7add1c\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b061c568ad94847a4b510bf61fea026ebfa04e4da98f5e3229f11fd2c53b48e7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b061c568ad94847a4b510bf61fea026ebfa04e4da98f5e3229f11fd2c53b48e7?s=96&d=mm&r=g\",\"caption\":\"Camden Segal\"},\"url\":\"https:\\\/\\\/webdevstudios.com\\\/author\\\/camden\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Unit Testing Your WordPress Plugins - WebDevStudios.com","description":"So you have an amazing plugin & it's starting to get bigger and the bug reports are piling up. Set up automated unit testing for your plugin & save the day!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/","og_locale":"en_US","og_type":"article","og_title":"Unit Testing Your Plugins","og_description":"So you have an amazing plugin & it's starting to get bigger and the bug reports are piling up. Set up automated unit testing for your plugin & save the day!","og_url":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/","og_site_name":"WebDevStudios","article_publisher":"http:\/\/facebook.com\/webdevstudios","article_published_time":"2014-08-07T04:27:02+00:00","article_modified_time":"2024-04-15T16:05:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2022\/11\/wds-default.png","type":"image\/png"}],"author":"Camden Segal","twitter_card":"summary_large_image","twitter_creator":"@webdevstudios","twitter_site":"@webdevstudios","twitter_misc":{"Written by":"Camden Segal","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/#article","isPartOf":{"@id":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/"},"author":{"name":"Camden Segal","@id":"https:\/\/webdevstudios.com\/#\/schema\/person\/82ed512295976e49907010f3490989c2"},"headline":"Unit Testing Your Plugins","datePublished":"2014-08-07T04:27:02+00:00","dateModified":"2024-04-15T16:05:42+00:00","mainEntityOfPage":{"@id":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/"},"wordCount":727,"commentCount":0,"publisher":{"@id":"https:\/\/webdevstudios.com\/#organization"},"keywords":["development tips","plugin development","unit testing"],"articleSection":["Development","Plugins","Products We Love","Tutorial","Workflow &amp; Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/","url":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/","name":"Unit Testing Your WordPress Plugins - WebDevStudios.com","isPartOf":{"@id":"https:\/\/webdevstudios.com\/#website"},"datePublished":"2014-08-07T04:27:02+00:00","dateModified":"2024-04-15T16:05:42+00:00","description":"So you have an amazing plugin & it's starting to get bigger and the bug reports are piling up. Set up automated unit testing for your plugin & save the day!","breadcrumb":{"@id":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webdevstudios.com\/2014\/08\/07\/unit-testing-your-plugins\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webdevstudios.com\/"},{"@type":"ListItem","position":2,"name":"Unit Testing Your Plugins"}]},{"@type":"WebSite","@id":"https:\/\/webdevstudios.com\/#website","url":"https:\/\/webdevstudios.com\/","name":"WebDevStudios","description":"WordPress Design and Development Agency","publisher":{"@id":"https:\/\/webdevstudios.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webdevstudios.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webdevstudios.com\/#organization","name":"WebDevStudios","url":"https:\/\/webdevstudios.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevstudios.com\/#\/schema\/logo\/image\/","url":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2019\/07\/wds-amp-logo.png","contentUrl":"https:\/\/webdevstudios.com\/wp-content\/uploads\/2019\/07\/wds-amp-logo.png","width":173,"height":60,"caption":"WebDevStudios"},"image":{"@id":"https:\/\/webdevstudios.com\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/facebook.com\/webdevstudios","https:\/\/x.com\/webdevstudios","http:\/\/instagram.com\/webdevstudios","https:\/\/www.linkedin.com\/company\/webdevstudios-llc-\/"]},{"@type":"Person","@id":"https:\/\/webdevstudios.com\/#\/schema\/person\/82ed512295976e49907010f3490989c2","name":"Camden Segal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b061c568ad94847a4b510bf61fea026ebfa04e4da98f5e3229f11fd2c53b48e7?s=96&d=mm&r=g4d2650ff7fd93cb54809dd154b7add1c","url":"https:\/\/secure.gravatar.com\/avatar\/b061c568ad94847a4b510bf61fea026ebfa04e4da98f5e3229f11fd2c53b48e7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b061c568ad94847a4b510bf61fea026ebfa04e4da98f5e3229f11fd2c53b48e7?s=96&d=mm&r=g","caption":"Camden Segal"},"url":"https:\/\/webdevstudios.com\/author\/camden\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3WX6u-2hW","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/posts\/8800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/comments?post=8800"}],"version-history":[{"count":0,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/posts\/8800\/revisions"}],"wp:attachment":[{"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/media?parent=8800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/categories?post=8800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/tags?post=8800"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/webdevstudios.com\/wp-json\/wp\/v2\/coauthors?post=8800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}