Viewing posts about Mock.

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

  • Tweeted | RT @mikeveerman: Ah 2018. Scrum means "Waterfall but we don't have time for analysis". Kanban means "Scrum, but we don't have time for sp…
  • Tweeted | RT @jonoringer: Shutterstock and Magic Leap Partner to Transform the Future of Reality [shutterstock.com/blog/magic-lea…] via @shutterstock
  • Tweeted | While I was messing around with a rescue lowering system today my kids got curious and we spent an hour configuring… [twitter.com/i/web/status/1…]
  • Blogged about hiking | Sheep Bridge Loop.
  • Opened a pull request at lorenwest/node-config
View more activities…