Viewing posts about Unit Testing.

Using Mocks with PHPUnit

Creating test doubles, or mocks, is a feature of PHPUnit that I recently discovered and am quickly falling in love with. Previously I would find other ways to mock my system, like creating SQLite connections instead of a persistent database, or even duplicating an entire mock class for injection.…

  • Category Web Development
  • Posted August 25, 2016
  • read more

Continuous Deployment with Travis CI and Digital Ocean

Continuous integration and deployment is one of my favorite parts about working at Shutterstock. The team can push, run automated tests, and deploy many times in a single day. I've been wanting to try to build up something like this for my own projects and, by using a combination of Digital Ocean,…

  • Category Web Development
  • Posted August 2, 2016
  • read more

Mocking Internal PHP Functions

A problem that I've run into during the unending quest for complete test coverage is mocking of internal PHP functions. Unit tests are easy to write as long as a class method returns everything it does, but when a method starts to call out to certain internal PHP functions things get difficult. It's…

  • Category Web Development
  • Posted May 31, 2016
  • read more

Unit Testing Data Repositories

Unit testing is something that I'm still rough around the edges with. I don't do it nearly enough at work and never really pushed myself to pick it up on the side. With my core site refactor, though, it seemed like a good time to wander into testing. And it made a lot of sense to write unit tests…

  • Category Web Development
  • Posted December 16, 2015
  • read more

Planning for Failure

When developing applications it is easy for programmers to think in terms of successful occurrences. Code is built to expect certain results because the programmer is thinking of how the application should work. Whether the specifications are being outlined or the code itself is being tested before…

  • Category Web Development
  • Posted October 28, 2012
  • read more

Activity Stream

  • Hiked 4.00 miles and felt alright.
  • Favorited KENZO World - The new fragrance on YouTube.
  • Blogged about hiking | Barnhardt - Sandy Saddle Loop.
  • Blogged about personal | Mountain Rescue Update.
  • Tweeted | This is magnificent. [twitter.com/alcor/status/1…]
View more activities…