All Posts Tagged with PHP

Cleaner Database Queries with Repositories

The traditional way to query something from the database is just to execute a bunch of SQL statements from the controller and get the results. Or maybe you use some package or a framework component to abstract the database ac...
Read more...

The Goodness of Parameter Objects

Sometimes in your code, you'll notice a pattern in which a group of parameters are tend to be passed together. Multiple methods will use the same group of parameters, because one will make no sense without the others. These m...
Read more...

Improve Your Design by Coding to Interfaces

There's a big chance that you've heard of the design principle “Code to an interface, not to an implementation” before, but you don't know what it means. Or maybe you don't know how to apply it in your code. If that's the cas...
Read more...

Writing Functional Tests with Codeception

In the introduction to testing article, we took a quick look at functional testing and why you would need to write them. Now, let's actually see how to write them. What tool to use? There are primarily two tools used to write...
Read more...

A Gentle Introduction to Testing in PHP

Learning testing can be very overwhelming especially if you're just starting out. I felt very overwhelmed when I started learning it. And after years of writing tests and learning how to write them (and I still do), I realize...
Read more...