-
Recent Posts
Recent Comments
Archives
- June 2025
- May 2025
- April 2025
- February 2025
- December 2024
- October 2024
- September 2024
- September 2023
- May 2023
- April 2023
- February 2023
- June 2022
- May 2022
- March 2022
- December 2021
- November 2021
- October 2021
- September 2021
- January 2021
- November 2020
- September 2020
- July 2020
- January 2020
- December 2019
- July 2019
- December 2018
- June 2018
- April 2018
- March 2018
- January 2018
- November 2017
- September 2017
- July 2017
- March 2017
- December 2016
- October 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- January 2016
Categories
Meta
-
Recent Posts
Recent Comments
Archives
- June 2025
- May 2025
- April 2025
- February 2025
- December 2024
- October 2024
- September 2024
- September 2023
- May 2023
- April 2023
- February 2023
- June 2022
- May 2022
- March 2022
- December 2021
- November 2021
- October 2021
- September 2021
- January 2021
- November 2020
- September 2020
- July 2020
- January 2020
- December 2019
- July 2019
- December 2018
- June 2018
- April 2018
- March 2018
- January 2018
- November 2017
- September 2017
- July 2017
- March 2017
- December 2016
- October 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- January 2016
Categories
Meta
Author Archives: Mark Baker
Parallel Looping in PHP with SPL’s MultipleIterator
There was a time, back when I was working with PHP 5, when I found the Standard PHP Library (SPL) an extremely powerful and useful toolbox; and I particularly enjoyed working with SPL’s Iterators and Datastructures. Sadly, SPL was always … Continue reading
Withdrawal from Speaking at PHPCE 2019
I’m always nervous when I speak at a conference or in front of a user group; but I also enjoy sharing my passion and excitement for things that I’ve learned, or new tools that I’ve discovered. That makes it particularly … Continue reading
A Year in Retrospect
At New Year, many people write a retrospective of the old year, and about their hopes and dreams for the new. The roots for my own changes over the last year really lie earlier: 2017 was the year when a … Continue reading
Using PHP Anonymous Classes as Package Private Classes
I’ve written before about the benefits of using PHP’s Anonymous Classes for test doubles; but Anonymous Classes also have potential usecases within production code as well. In this article I’m going to describe one such usecase that can be particularly … Continue reading
Discharging Static #2
In the first article in this series, I wrote about the problems with testing static methods in classes, and showed a few approaches that allow us to write mocks for statics. Testing classes where we have static properties is a … Continue reading
Aspects of Love — How deep does the rabbit hole go?
If you’ve read my previous post (Discharging Static #1), then you’ll know that recently I’ve been exploring different approaches to creating test doubles for statically called methods, and other testing problems, and had begun to look at Michael Bodnarchuk’s AspectMock library … Continue reading
Discharging Static #1
It’s been seven years since Kore Nordmann first published “static considered harmful” on his blog, explaining the problems with using static method calls in classes, and the difficulties that they cause when trying to test that class. Seven years on, … Continue reading
Closures, Anonymous Classes and an alternative approach to Test Mocking (Part 4)
In a prior article in this series, I described the use of a SpyMaster Class to create proxy spies as anonymous classes, that allow external visibility (and potentially update) of protected and private properties within an object. The same basic principle … Continue reading
Extending final Classes and Methods by manipulating the AST
We know that we should always write unit tests for our code, and mock dependencies; but that isn’t always easy when we need to mock classes define as final, or that contain final methods. This isn’t normally a problem when … Continue reading
Closures, Anonymous Classes and an alternative approach to Test Mocking (Part 3)
I have heard people say that you shouldn’t test abstract classes or traits, only the concrete classes that implement or use them. I don’t follow that approach: unit testing is all about testing in isolation from anything that might affect those … Continue reading