Successfully reported this slideshow.

How Testing Changed My Life

9

Share

Loading in …3
×
1 of 24
1 of 24

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

How Testing Changed My Life

  1. 1. HOW TESTING CHANGED MY LIFE Nikolay bachiyski, automattic Wordcamp san francisco, aug 13, 2011
  2. 2. Next 30 minutes
  3. 3. 0. what?
  4. 4. 1. example plugin
  5. 5. 2. do it yourself!
  6. 6. what?
  7. 7. 0. what? Automated http://www.flickr.com/photos/binaryape/4882162452/
  8. 8. xUnit 0. what?
  9. 9. PHPUnit http://www.phpunit.de/manual/current/en/ 0. what?
  10. 10. class  WP_Is_Email_Test  extends  WP_UnitTestCase  {        function  test_is_email_only_letters_with_dot_com_domain()  {                $this-­‐>assertEquals(  'nb@nikolay.com',  is_email(  'nb@nikolay.com'  )  );        }                function  test_is_email_should_not_allow_missing_tld()  {                $this-­‐>assertFalse(  is_email(  'nb@nikolay'  )  );        }                function  test_is_email_should_allow_bg_domain()  {                $this-­‐>assertEquals(  'nb@nikolay.bg',  is_email(  'nb@nikolay.bg'  )  );        } } 0. what?
  11. 11. class  WP_Is_Email_Test  extends  WP_UnitTestCase  {        function  test_is_email_only_letters_with_dot_com_domain()  {                $this-­‐>assertEquals(  'nb@nikolay.com',  is_email(  'nb@nikolay.com'  )  );        }                function  test_is_email_should_not_allow_missing_tld()  {                $this-­‐>assertFalse(  is_email(  'nb@nikolay'  )  );        }                function  test_is_email_should_allow_bg_domain()  {                $this-­‐>assertEquals(  'nb@nikolay.bg',  is_email(  'nb@nikolay.bg'  )  );        } } 0. what?
  12. 12. 0. what?
  13. 13. Example Plugin WP_Bearify
  14. 14. do it yourself! 2. do it yourself!
  15. 15. Grab the Framework https://github.com/nb/wordpress-tests soon in core 2. do it yourself!
  16. 16. Please, read http://xunitpatterns.com/ at least Narratives: http://xunitpatterns.com/Book %20Outline.html 2. do it yourself!
  17. 17. PHPUnit http://www.phpunit.de/manual/current/en/ 2. do it yourself!
  18. 18. PHPUnit in your editor https://github.com/meritt/phpunit-tmbundle/ https://github.com/klokane/vim-phpunit 2. do it yourself!
  19. 19. FEAR!
  20. 20. FEAR!
  21. 21. http://www.flickr.com/photos/eebrierley/5394195199/
  22. 22. warm & cozy > FEAR

×