Definition of Success

Last time I had a task to optimize a cache deletion in a legacy code which seemed weird and it begged for refactoring. So I started it and ran into some unexpected behaviour in the PHP Memcache library methods. Before I go forward here is the original method: What does the original method do? First… Continue reading Definition of Success

Mock global functions with PHPUnit

I have worked on many different PHP-based projects and sometimes I need to modify old and not clean codes. There I have faced untested codes. However, not just there could need to mock global functions. Sometimes we need that for PHP built-in functions also. The code For example, you have a similar class:src/DateGetter.php As you… Continue reading Mock global functions with PHPUnit