Articles with tag "unit testing"

Dynamic context in Rspec - don’t repeat yourself

Advanced rspec features allow to use very effective technique to organize tests. You are able to construct and define context in more flexible way than before. We use to have less problems with subject and behavior. And context is what testing is all about. Just because web apps manage data, behavior seriously depends on current state of the database.
Comments: 1964     Views: 10135     Rating: 12345

Automated Testing Using Zend Framework

Automated testing for your web applications is an important step in having the confidence to make changes to your application, and still be confident you’re delivering a quality, regression-free product. With Zend Framework’s testing framework (built with PHPUnit), you can build a thorough suite of test cases for your web application with very little hassle.
This article will give you all of the basic information you need to start writing automated tests for your Zend Framework applications.
Comments: 1848     Views: 14562     Rating: 12345

An Introduction to the Art of Unit Testing in PHP

Testing is an essential aspect of developing in any programming language. If you don't test your source code then how can you verify it works as expected? Manual testing can only be performed irregularly and usually only in limited ways. The answer to testing source code regularly, and in depth, is to write automated tests which can be frequently executed. In PHP such tests are usually written using a unit testing framework, a framework which allows the source code of any application or library to be tested as isolated units of functionality such as a single class or method. As unit testing has gained popularity, it has become a standard practice in PHP with libraries and frameworks such as Swiftmailer, the Zend Framework and Symfony all requiring unit test coverage of their source code.
Unit Testing is often seen as an arcane, time consuming task - which it sometimes can be! But the point of spending time writing tests is to improve the quality of your source code so it has fewer overall bugs, many of which are detected early, a continual testing process to prevent new changes from changing the behaviour of older code, and to provide confidence that your code can be depended on. There are other benefits too, and we'll detail these later.
Comments: 12     Views: 8026     Rating: 12345