Advertisement

PHPUnit

Latest Posts
  • Code
    PHP
    All About Mocking with PHPUnitMocking in php
    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…
  • Code
    PHP
    Hands-On Unit Testing With PHPUnitUnit testing
    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…
  • Code
    Creative Coding
    The Theory of Unit Testing, Part 3Part3 thumbnail
    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…
  • Code
    Creative Coding
    The Theory of Unit Testing, Part 2Part2 thumbnail
    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…
  • Code
    Creative Coding
    The Theory of Unit Testing, Part 1Part1 thumbnail
    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…
Advertisement
Advertisement