15.6. Summary

Automated tests include unit tests to validate methods or functions and functional tests to validate features. Symfony relies on the lime testing framework for unit tests and provides an sfTestBrowser class especially for functional tests. They both provide many assertion methods, from basic to the most advanced, like CSS selectors. Use the symfony command line to launch tests, either one by one (with the test:unit and test:functional tasks) or in a test harness (with the test:all task). When dealing with data, automated tests use fixtures and stubs, and this is easily achieved within symfony unit tests.

If you make sure to write enough unit tests to cover a large part of your applications (maybe using the TDD methodology), you will feel safer when refactoring internals or adding new features, and you may even gain some time on the documentation task.

« Previous
15.5. Special Testing Needs
Next »
Chapter 16 - Application Management Tools
Los contenidos originales de este sitio están bajo una licencia de Creative Commons. Las traducciones disponen cada una de su propia licencia.