Why is one phpunit test throwing an error on one class when all other classes are similar without error?

the async property is marked as protected, so that usually signifies that it is related more to your implementation’s details rather than functionality. Ideally you would write your tests to test the public methods you have exposed. Testing that the class property you set in the constructor of one class is an instanceof what was initialized doesn’t provide any constructive feedback tbh. Testing for instance that prepare_data in that class actually prepared the data the way you expected, would let you know that the class instance was instantiated.

That aside though – it looks like you have a PHP magic __get throwing an exception on L319:
https://github.com/LiquidChurch/lqd-messages/blob/master/gc-sermons.php#L319

So just add async handling for that property because it can’t be accessed outside of the class.

Just another note it’s best to use assertInstanceOf instead of instanceof for your testcase.

tech