PHPUnit

If you want to learn about Symfony 2, you're in luck. We've published three new video courses taking you through all the stages of working with this PHP framework, from getting started through to building a CMS and beginning testing.

If you want to learn about Symfony 2, you're in luck. We've published three new video courses taking you through all the stages of working with this PHP framework, from getting started through to building a CMS and beginning testing.Read More…

Old code. Ugly code. Complicated code. Spagetti code. Jibberish nonsense. In two words, Legacy Code. This is a series that will help you work and deal with it.
In our previous lesson we've learned a new way to understand and make code better by extracting till we drop. While that tutorial was a good way to learn the techniques, it was hardly the ideal example to understand the benefits of it. In this lesson we will extract till we drop on all of our trivia game related code and we will analyze the final result.

Old code. Ugly code. Complicated code. Spagetti code. Jibberish nonsense. In two words, Legacy Code. This is a series that will help you work and deal with it.
In our previous lesson we've learned a new way to understand and make code better by extracting till we drop. While that tutorial was a good way to learn the techniques, it was hardly the ideal example to understand the benefits of it. In this lesson we will extract till we drop on all of our trivia game related code and we will analyze the final result.Read More…

Follow along as I walk you through using Symfony 2's Crawler to write basic functional tests. We'll learn how to test the entire spectrum of implementing a controller, template, and route by writing functional tests to test their integration as a whole, using PHPUnit.

Follow along as I walk you through using Symfony 2's Crawler to write basic functional tests. We'll learn how to test the entire spectrum of implementing a controller, template, and route by writing functional tests to test their integration as a whole, using PHPUnit.Read More…

Today, we will take another approach: We will assume we are alone, no colleague or pair to help us. We will use a technique called "Extract till you drop" that breaks code in very small pieces. We will make all the efforts we can to make these pieces as easy to understand as possible

Today, we will take another approach: We will assume we are alone, no colleague or pair to help us. We will use a technique called "Extract till you drop" that breaks code in very small pieces. We will make all the efforts we can to make these pieces as easy to understand as possibleRead More…

There are two styles of testing: "black box" and "white box" styles. Black box testing focuses on the object's state; whereas, white box testing focuses on behavior. The two styles complement each other and can be combined to thoroughly test code. Mocking allows us to test behavior, and this tutorial combines the mocking concept with TDD to build an example class that uses several other components to achieve its goal.

There are two styles of testing: "black box" and "white box" styles. Black box testing focuses on the object's state; whereas, white box testing focuses on behavior. The two styles complement each other and can be combined to thoroughly test code. Mocking allows us to test behavior, and this tutorial combines the mocking concept with TDD to build an example class that uses several other components to achieve its goal.Read More…

In this screencast, we'll build a relatively simple class, using TDD techniques. Along the way, we'll discuss various PHPUnit methods, how to create mock objects, and more! I encourage you to work along; it's the best way to learn!

In this screencast, we'll build a relatively simple class, using TDD techniques. Along the way, we'll discuss various PHPUnit methods, how to create mock objects, and more! I encourage you to work along; it's the best way to learn!Read More…

In the past two articles, we've taken a close look at the theory behind unit testing and how it can help us in our WordPress development efforts. We've defined unit testing and examined various ways that it can help us throughout our projects.
But we still have more to cover.
In this final article, we'll review why we should even bother doing unit testing and we'll summarize the advantages and disadvantages of doing it. Next, we'll look at how we can retrofit testing into our existing projects. And to wrap up, we'll summarize a list of resources that are available specifically to us WordPress developers that will aid in beginning to unit test our themes.

In the past two articles, we've taken a close look at the theory behind unit testing and how it can help us in our WordPress development efforts. We've defined unit testing and examined various ways that it can help us throughout our projects.
But we still have more to cover.
In this final article, we'll review why we should even bother doing unit testing and we'll summarize the advantages and disadvantages of doing it. Next, we'll look at how we can retrofit testing into our existing projects. And to wrap up, we'll summarize a list of resources that are available specifically to us WordPress developers that will aid in beginning to unit test our themes.Read More…

In the last article, we began talking about the theory of unit testing in WordPress. Specifically, we reviewed our work on unit testing themes and plugins then began to discuss units of code, how this impacts our testing, and we reviewed unit testing in the larger world of software development.

In the last article, we began talking about the theory of unit testing in WordPress. Specifically, we reviewed our work on unit testing themes and plugins then began to discuss units of code, how this impacts our testing, and we reviewed unit testing in the larger world of software development.Read More…

We've been looking at unit testing for WordPress development. Through the use of practical examples, we've reviewed what unit testing looks like for both plugins and for themes; however, we haven't really talked about the the theory behind unit testing.

We've been looking at unit testing for WordPress development. Through the use of practical examples, we've reviewed what unit testing looks like for both plugins and for themes; however, we haven't really talked about the the theory behind unit testing.Read More…