Hi there! I'm Juan Treminio.

I am a Texas-based web developer with a strong focus on PHP and the LAMP stack. As you can tell, I have a fascination with testable code. If you are looking for an experienced developer to create a new application, write new features into an existing application, or help you make your application better by creating tests or refactoring code then we should get in touch!

Get in Touch – or – Read My Blog

What I Offer

Senior Developer

I have worked on everything from small blogs to large, enterprise applications. eCommerce, CMS and more are in the bag! PHP/MySQL, HTML/CSS, Javascript? Yup!

Completely Tested Code

All my code comes fully tested with PHPUnit. No more crossing your fingers hoping a feature works as advertised, thanks to the confidence tested code brings to the table!

Consulting Services

Do you need a hand in engineering your new awesome application? Want to implement TDD but not sure how to start? Got spaghetti code? I can help get you on the right track.

Latest From My Blog

Make $ vagrant up yours

Vagrant is a command line tool to manage virtual machines. Puppet is a command line tool to install software on virtual machines. PuPHPet is an unpronounceable GUI tool to help take the pain out of working with both!

Why should I use a virtual machine?

Being a PHP developer has a much lower barrier to entry than Python, Ruby. Only Javascript is easier to start with. Tools such as XAMPP, MAMP, Homebrew, etc, make installing a basic LAMP stack on your computer extremely easy.

So why would you want to give this up and use a slow, bulky and cryptic virtual machine?

Some tools are difficult to install

I used to develop using XAMPP on Windows. Attempting to install any PEAR packages would cause my hair to fall out. PEAR is old, it should work 100% of the time.

If PEAR is no problem for you, think about how involved tools like memcached, APC, Gearman, etc, are to install on a proper server and then think about the steps that may require to be different on a non-server OS.

Some programs on your daily OS may interfere

Did you know Skype uses port 80 by default, unless you tell it otherwise? What other programs that you use may interfere in unknown ways with a server?

It works on my machine

Nothing makes me go into table-flipping mode faster than this phrase. Eliminate inconsistencies between your development environment and your production environment by mimicking prod as close as possible.

Continue reading

Introduction to Vagrant/Puppet and introducing PuPHPet - A simple to use Vagrant/Puppet GUI Configurator!

I just released the initial version of PuPHPet, my GUI-based generator for Vagrant/Puppet environments!

That is a mouthful, so let me explain the what, why and how!

What is Vagrant?

Vagrant is for managing VMs. If you previously read my length tutorial, Setting Up a Debian VM, Step by Step, you know how tiresome and error-prone setting up a virtual machine can be.

Errors suck!

Spending time away from developing sucks!

Vagrant can help!

Vagrant helps abstract and automate the initial setup of a virtual machine. Basically everything from the initial OS setup, to assigning a static IP address and sharing folders between host and slave are handled with a few short lines in Vagrant.

Vagrant is also easy to read and understand. Heck, just take a look at my default Vagrantfile - even if you have never encountered Vagrant before you can probably pick up on what is going on in that file… mostly, anyway!

It also allows you to boot up, shut down, suspend, reload and package your VM for the command line, all with some very simple, easy to remember commands.

Vagrant is great for the basics - but that is as far as you should use it, only for the initial set up. For more complicated tasks like installing software packages, configuring installed packages, setting up users, creating MySQL tables and more, you should use what Vagrant calls provisioners. Out of the box, Vagrant has support for shell (basically sh files), Chef and Puppet. You are free to use any provisioner you want - at the end of the day they all end up doing the same thing - but I have chosen to go with Puppet.

Continue reading

Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors

Previously in my PHPUnit tutorial series, you learned about the very powerful concept of mock objects and stub methods. This concept is central to successful unit testing, and once it fully ‘clicks’ in your head you will start to realize how useful and simple testing can be.

There is also another thing I want to make clear: creating tests is basically a puzzle - you simply have to go step by step, making sure all the pieces fit together correctly so you can get your green. I hope to make clear what I mean by the end of this tutorial.


In my previous tutorial you learned all about mock objects and stub methods. There is another very similar concept you must also know about: mock methods.

To recap:

Mock Object

A mock object is an object that you would create using PHPUnit’s getMockBuilder() method. It is basically an object that extends the class you define and allows you to perform nifty tricks and assertions on it.

Stub Method

A stub method is a method contained within a mock object that returns null by default, but allows you to easily override the return value.

Mock Method

A mock method is pretty simple - it does the exact same thing its original method would. In other words any code that is in the method you are mocking will actually run and will not return null by default (unless that is what it originally did).

Mark Nichols gives a very good explanation of what the difference between mock and stub methods are.

Basically mock methods are useful for when you want the code inside of it to run, but also want to do some assertions on the behavior of the method. These assertions could be that specific parameters are passed to the method (if it applies), or that the method is called exactly 3 times or not at all.

Do not worry if this does not make immediate sense yet.

Continue reading