Simple test drupal7_presentation_la_drupal_jul21-2010

download Simple test drupal7_presentation_la_drupal_jul21-2010

If you can't read please download the document

description

Presentation I gave @ LA Drupal meetup (in Echo Park) on July 21, 2010 on SimpleTest integration into Drupal 7.

Transcript of Simple test drupal7_presentation_la_drupal_jul21-2010

  • 1. SimpleTest, Drupal 7 & You
    • Miguel Hernandez LA Drupal (Echo Park) July 21, 2010

2. Who Am I?

  • Miguel Hernandez -http://migshouse.com

3. Founder/Head Geek @ the OpenMindz Group-http://openmindz.net 4. Member of Drupals Core Patch Testing Team since 2009 5. Started working in Software QA in 1999 6. Huge passion for breaking things & seeing how they work 7. Why Should You Care?

  • SimpleTest included in Drupal 7 Core

8. Module is now called Testing 9. Produce better code 10. Improves & speeds up SDLC 11. Best practices approach to development 12. Test-driven development (TDD) 13. What is SimpleTest

  • An open source unit testing framework for PHP

14. Unit testing is a method by which individual units of source code are tested to see if they are fit for use 15. A unit is the smallest testable part of an application, web or otherwise 16. In Drupal, the smallest units are functions 17. Why is it included in D7 core?

  • Needed a way for developers & contributors to produce better code

18. Drupal needed a framework for running automated unit tests 19. Helps immensely in taking Drupal from alpha > beta > release candidate 20. Developers can now include tests w/their modules 21. Setting up SimpleTest

  • Ensure module is enabled

22. Check settings at /admin/config/development/test/settings 23. Performance, Logging/Errors, Maintenance Mode, Testing 24. Performance

  • Clearing the cache is very important if youre not seeing a test that should be there (i.e. One that you just created)

25. Caching & Bandwidth Optimization can be set on an as-needed basis 26. Logging & Errors

  • It is suggested to set Error Messages to Display to All Messages.

27. However, if the site is running in a production environment, set it to not display any messages 28. This is due to performance reasons 29. Maintenance Mode

  • It is suggested to place the site in Maintenance Mode

30. Especially, if running on a production environment 31. Remember to login with an admin user at http://yoursite.com/user 32. Debug settings

  • View/edit Testing Settings at /admin/config/development/testing/settings

33. Clearing results after each test is run is good but you might want to keep them (i.e. Viewing of results over time, etc.) 34. Verbose mode is highly suggested to be turned on 35. Lets see it in action!

  • /admin/config/development/testing

36. Provides a complete list of all tests included in both core & through contributed modules 37. Can select individual tests, a group of tests by test type or ALL tests 38. Thats it!

  • Not as hard as you thought, eh?

39. Next time, well go over how to create your own test cases for your own modules & how to incorporate them into your daily workflow 40. Or you can see my session @DrupalCampLA: 41. http://2010.drupalcampla.com/sessions/simpletest-intro-how-get-started-why 42. Resources

  • http://simpletest.org

43. http://drupal.org/simpletest-tutorial 44. http://drupal.org/project/simpletest 45. http://drupal.org/unit-testing 46. http://acquia.com/files/test-results/index.html 47. http://drupalcampla.com 48. http://migshouse.com