PHPUnit
The subject of mocking a PDO object in PHPUnit has come around a few times lately. It cannot be done like normal classes because a PDO object cannot be serialized. $pdo = $this->getMockBuilder(‘PDO’) ->disableOriginalConstructor() ->getMock(); This will work on another class, but with PDO you will get this error: PDOException: You cannot serialize or unserialize [...]
A few months ago, I wrote about continuous testing. When I wrote that post, I was using watchr to run my tests. A few weeks ago, I started using Guard instead of watchr and I wouldn’t go back. Reasons to Change One of the problems I had with watchr, is that it did not see [...]
Continuous testing is a way to automate the execution of your tests while you work. This makes the feedback loop very short. As soon as you save a file, the tests are run and you know right away if anything fails. Autotest I discovered continuous testing over a year ago when I watched a video [...]
Test driven development (TDD) is at the core of the Agile Methodology and Extreme Programming. This practice has been known for a while and a lot have been written on it. However, I still meet developers that don’t know what it is. I understand that many employers won’t let their employees write tests, but we [...]
In a previous post, I talked about Continuous Integration. If your Continuous Integration server runs on every commits, it will help you keep your code quality high. It will also make integration a non issue. However, when I make a mistake, produce sub-optimal code or if I write code that does not respect our coding [...]
According to Wikipedia, continuous integration implements continuous processes of applying quality control — small pieces of effort, applied frequently. In simple terms, you verify that your project meets the quality standards frequently. This way, you can catch any deviation early. Doing the integration in small increments makes it easier. Implementing a continuous integration server can [...]
Recent Comments