Updated the PHPUnit CakePHP installer

Just a quick note, the CakePHP PHPUnit installer has been updated to use version 3.7.8. Go grab it here if you are no fan of PEAR and want a self contained PHPUnit testing system. Works on Mac OSX, Linux and Windows.

Using Sessions in PHPUnit Tests with CakePHP

I was breaking my head over failing unit tests when trying to test a simple Controller that was saving a new record. Turned out it was failing only on the command line, while the webversion was passing all the tests. Luckily, the solution was simple .. The PHPUnit command line suite apparently outputs contents early, before the session gets initiated. Solution 1 Add --stderr to the command line: $ cake testsuite app Controller/YourFancyController --stderr This will pass the tests again, as it doesn’t output contents early to STDOUT.

Updated LESS component for CakePHP

I decided to have a look at Twitter Bootstrap 2, and had it run through my LESS Component. I then realized the component didn’t support subfolders! So this is just to let you guys know I wrote a small tweak, and now it works perfectly :) If you have any other alterations you would like to see feel free to fork, or drop me a comment below. The new version: https://github.

PHPUnit Installer updated to 3.6.4

Just a small update .. I updated the PHPUnit Installer Shell for CakePHP 2.0 to use version 3.6.4. All dependencies have been updated as well, so it’s 23% more awesome.

Installing PHPUnit manually for CakePHP 2.0

I was trying to get into Unit Testing a few months ago. It was a steep learning curve and eventually I gave myself a non-excuse and decided to wait for Cake 2.0 as that would have PHPUnit and it “wouldn’t make sense to learn SimpleTest” at that time. I intend to keep that promise and have been trying to get into Unit Testing for real this time. The first thing was also the most annoying so far: installing the (&#(&.

Using LESS in CakePHP

I was a bit bored this morning with my previous Less component, so decided to rewrite the thing and added some new features such as caching. It’s pretty straightforward and simple to set up. If you can’t wait, the code is available here. For more information, read on. This little helper converts your .less files into .css without relying on Node.js Installation Clone Clone from github: in your plugin directory type:

Using Markdown in CakePHP

Markdown rocks. I lately fell in love with it when I was setting up this very blog. You can just write easy-to-read and easy-to-write plain text files, and Markdown takes care of the rest. For this blog I had used a Markdown script I found that parses plain text and outputs it as HTML. It allows me to write posts in a simple/plain format and just pump it into the database as is.

How to handle multiple domains with CakePHP

Lately, we’ve been working with multiple environments/servers for our websites to be able to have them approved by clients before going live. However, following set up can also work nicely when you develop your sites locally and don’t want to keep changing the configuration every time you upload it. Setting up the database config file So, what changes in your config? Not all that much. Let’s have a look at the default database.

Using SASS in your next CakePHP project

When I first saw some examples I thought the idea was good, but didn’t see the point of learning a new syntax in order to not having to use the CSS syntax. Because, honestly, how does typing some curly brackets and semicolons hurt? I did like the idea of inheretance by indentation though. By indenting subsequent selectors it saves a lot of repetitive class assigning and declarations. But I hate adding extra layers onto things.

Setting up CakePHP with MAMP Pro on Mac OSX

I’d like to use my first post to describe how I set up new projects in a simple way that works best for me. My setup is pretty straight-forward, really. I know some people who mess about with include-paths so they can run multiple apps on one cake-install, but since I work for various clients and even more various projects I like my project folders to be self-contained. Downloading CakePHP Easy enough.