{"id":34326,"date":"2019-02-15T16:38:50","date_gmt":"2019-02-15T14:38:50","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=34326"},"modified":"2019-02-15T16:38:57","modified_gmt":"2019-02-15T14:38:57","slug":"tips-to-speed-up-your-phpunit-tests","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2019\/02\/15\/tips-to-speed-up-your-phpunit-tests\/","title":{"rendered":"Tips to Speed up Your PHPunit Tests"},"content":{"rendered":"<!-- google_ad_section_start -->\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"254\" data-attachment-id=\"34327\" data-permalink=\"https:\/\/mamchenkov.net\/wordpress\/2019\/02\/15\/tips-to-speed-up-your-phpunit-tests\/paratest\/\" data-orig-file=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/paratest.png?fit=600%2C254&amp;ssl=1\" data-orig-size=\"600,254\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"paratest\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/paratest.png?fit=600%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/paratest.png?resize=600%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-34327\" srcset=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/paratest.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/paratest.png?resize=500%2C212&amp;ssl=1 500w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I came across this collection of &#8220;<a href=\"https:\/\/laravel-news.com\/tips-to-speed-up-phpunit-tests\">Tips to Speed up Your PHPunit Tests<\/a>&#8220;.  Apart from the few usual ones, like disabling XDebug and using groups, I found a couple that linked to handy tools:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/paratestphp\/paratest\">ParaTest<\/a> &#8211; a PHPUnit extension that runs PHPUnit tests in parallel, significantly minimizing the test run time, and<\/li><li><a href=\"https:\/\/marmelab.com\/phpunit-d3-report\/\">PHPUnit Report<\/a> &#8211; a tool that visualizes test run times, clearly showing which unit tests take the longest to run.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"402\" data-attachment-id=\"34331\" data-permalink=\"https:\/\/mamchenkov.net\/wordpress\/2019\/02\/15\/tips-to-speed-up-your-phpunit-tests\/fix-slow\/\" data-orig-file=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/fix-slow.png?fit=536%2C402&amp;ssl=1\" data-orig-size=\"536,402\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fix-slow\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/fix-slow.png?fit=536%2C402&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/fix-slow.png?resize=536%2C402&#038;ssl=1\" alt=\"\" class=\"wp-image-34331\" srcset=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/fix-slow.png?w=536&amp;ssl=1 536w, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/02\/fix-slow.png?resize=500%2C375&amp;ssl=1 500w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Very cool!  Needs trying &#8230;<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>I came across this collection of &#8220;Tips to Speed up Your PHPunit Tests&#8220;. Apart from the few usual ones, like disabling XDebug and using groups, I found a couple that linked to handy tools: ParaTest &#8211; a PHPUnit extension that runs PHPUnit tests in parallel, significantly minimizing the test run time, and PHPUnit Report &#8211; &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2019\/02\/15\/tips-to-speed-up-your-phpunit-tests\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Tips to Speed up Your PHPunit Tests<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Tips to Speed up Your PHPunit Tests #WebDev #PHP #PHPUnit #performance #QA","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62,1334],"tags":[1057,38,3492,3074,1330],"keyring_services":[],"class_list":["post-34326","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","category-web-work","tag-performance","tag-php","tag-phpunit","tag-quality-assurance","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":27289,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/02\/03\/preparing-for-the-phpunit-6-and-php-7\/","url_meta":{"origin":34326,"position":0},"title":"Preparing for the PHPUnit 6 and PHP 7","author":"Leonid Mamchenkov","date":"February 3, 2017","format":false,"excerpt":"If you woke up today and found that most of your PHP projects' and libraries' tests break and fail, I have news for you: \u00a0you are doing something wrong. \u00a0How do I know? \u00a0Because I was doing something wrong too... First of all, let me save you all the extra\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2017\/02\/travis-phpunit-500x317.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":28455,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/03\/26\/atoum-modern-simple-and-intuitive-php-unit-testing-framework\/","url_meta":{"origin":34326,"position":1},"title":"atoum &#8211; modern, simple and intuitive PHP unit testing framework","author":"Leonid Mamchenkov","date":"March 26, 2018","format":false,"excerpt":"With all the hype around the quality assurance and testing tools for PHP, I wonder how did I miss atoum.\u00a0 Atoum is a modern, simple and intuitive unit testing framework for PHP.\u00a0 From a quick look around, it seems to be a lot simpler than PHPUnit and I definitely need\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27493,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/04\/09\/phpunit-snapshot-assertions-a-way-to-test-without-writing-actual-test-cases\/","url_meta":{"origin":34326,"position":2},"title":"PHPUnit Snapshot Assertions &#8211; a way to test without writing actual test cases","author":"Leonid Mamchenkov","date":"April 9, 2017","format":false,"excerpt":"phpunit-snapshot-assertions - is an interesting addition to the PHPUnit assertions which allows testing against previously created snapshots. \u00a0This is particularly useful for testing the outputs of API end-points, format conversion functions, and the like. \u00a0Instead of testing the actual functionality, these assertions allow to compare the output of the current\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27809,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/07\/29\/improving-the-output-of-phpunit\/","url_meta":{"origin":34326,"position":3},"title":"Improving the output of PHPUnit","author":"Leonid Mamchenkov","date":"July 29, 2017","format":false,"excerpt":"Via \"Improving the output of PHPUnit\" I've learned about\u00a0PHPUnit Emoji Result Printer. \u00a0Obviously, this sounds like fun, but I'm also sure there is some really smart way of using this. Too bad I couldn't try it on one of our work projects just yet, as this requires PHPUnit 6+, while\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2017\/07\/phpumoji-500x127.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":26688,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/09\/16\/bitbucket-pipelines-and-docker-for-php-developers\/","url_meta":{"origin":34326,"position":4},"title":"BitBucket Pipelines and Docker for PHP Developers","author":"Leonid Mamchenkov","date":"September 16, 2016","format":false,"excerpt":"I've been meaning to look into Docker for a long while now. \u00a0But, as always, time is the issue. \u00a0In the last couple of days though I've been integrating BitBucket Pipelines into our workflow. \u00a0BitBucket Pipelines is a continuous integration solution, which runs your project tests in a Docker container.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":18239,"url":"https:\/\/mamchenkov.net\/wordpress\/2013\/05\/27\/ua-testing-with-selenium-and-phpunit\/","url_meta":{"origin":34326,"position":5},"title":"UA Testing with Selenium and PHPUnit","author":"Leonid Mamchenkov","date":"May 27, 2013","format":"link","excerpt":"UA Testing with Selenium and PHPUnit","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/34326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=34326"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/34326\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=34326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=34326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=34326"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=34326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}