Tag: php
Replace symfony service in a codeception functional test
I have a love/hate relationship with codeception. When it works, it’s my prince charming on a white horse coming to rescue me from the plight of testing. But ever so often it’s a convoluted and badly documented mess that wrecks havoc to my productivity as I frantically search the net for the one blog post that could help me out. Maybe this can be one those blog posts for somebody else. It’s about how to replace a service (i.e. with a mock) inside the symfony container in a functional test.
Continue readingAn empty string does not need to be empty. Just empty enough.
PHP’s “empty” function is a weird little fellow. Basically, it tests if a given variable exists and is not evaluated to false !isset($var) || $var == false
And since PHP and has a unique interpretation of what counts as false, I try to replace it with a more explicit counterparts whenever possible. It still creeps up on me sometimes, in places long forgotten, written by a much less careful version of myself. Like a few days ago, when a colleague of mine walked into my office complaining about why our internal system didn’t except his CSV file anymore.
PHP, Apache, and the session that could not die
I am not really a web guy, coming from an operating systems and Java background. But for some reasons, I’ve been working on a Symfony3 project for the past year. I learned a lot and developed a deep love-hate relationship with both PHP and JavaScript. They have their strengths and weaknesses and I can respect that. But man, the way Apache and PHP are configured is just evil!
Continue reading