

I agree if it’s checking if a method gives the right output for a specific input. But i’m more concernd with checking if it issued the right side effects, i.e. called right services and so on and then checking if it made right calls to the mocks.


I agree if it’s checking if a method gives the right output for a specific input. But i’m more concernd with checking if it issued the right side effects, i.e. called right services and so on and then checking if it made right calls to the mocks.


There is also this gem in the post:
You shouldn’t be mocking your methods, you should mock your IO. And, similarly, you shouldn’t test methods, but rather software functionality
I totally agree! With containers you might not even have to mock your IO but can check if the application behaves correctly.
To add what the others said, yesterday morning there was news that every php version is vulnerable but the fixes were published very late in the day (or whenever depending on timezone) thus there was a 8+hours of unceartiny and fear for administrators. A lot of websites shut down due to that.
Yes always is probably wrong, but not having global state allows you to argue just by function signature and allows easier unit testing and multithreading and probably more.