Viewing posts about Phpunit.

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

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

Activity Stream

  • Blogged about hiking | Under-the-Rim at Bryce Canyon.
  • Tweeted | RT @rhein_wein: There is some cool math behind why this happens. Let's take this example: each customer at a bank takes an average of 10 m…
  • Read Leviathan Falls (The Expanse #9) by James S.A. Corey.
  • Tweeted | @nickguillory Been there. No idea why “current balance” is even an option on that interface. Navient, if I had 20k+… [twitter.com/i/web/status/1…]
  • Tweeted | Tillman Run was a blast ✅ — trying to do a 4.2 mile run with three kids and manage them seemed like a really dumb i… [twitter.com/i/web/status/1…]
View more activities…