A spelling and grammar checker for Node

When you need to write in a foreign language, you'll probably use Google Translate. An awesome service that does a great job for translating individual words. But what about the grammar of a sentence? Like for example 'Edwards will be sck yesterday'. It will corrects 'sck' to 'sick', but it doesn't correct 'will be' to 'was'. Thankfully there are some other services for that and I created a Node wrapper for one of them. Say hello to Gingerbread.

Continue reading

Handle authenticated users in Behat/Mink

One of the latest addition to PHP's testing tools is Behat. A test framework that focusses on business expectations (behavior driven development) versus the good ol' unit tests of PHPUnit (test driven development). In short, with BDD you are describing your functionality instead of testing your functionality with TDD afterwards. If you use Behat in combination with Mink, you can test the behaviour of your application in the browser. It simulates the interaction between users and your application. But what if you have any authentication mechanism in your application, do you need to go through the login form in any test? The answer is no. And in this article I'll explain how.

Continue reading

Running Symfony on Heroku

If you're a PHP-only developer, odds are that you've never heard of Heroku. It's one of the popular SAAS providers out there, but was targeting Ruby applications in the beginning. Nowadays they support almost everything with help of so-called buildpacks. They currently don't have an official PHP buildpack (yet), but thanks to Christoph Hochstrasser you can deploy your PHP applications to Heroku.

Continue reading

Mock Guzzle responses in Symfony tests

Most of the web applications out there have at least one integration with an external service. Like with Twitter for pulling in tweets for example. On the other hand, most of the web applications have (or should have) functional testing setup to be less error prone when deploying new releases. You want these tests to be executed as quick as possible and test every possible scenario that could happen with your external service integration.

I had the same with my Twitter integration (the latest tweet bar on top of this site). These are fetched with the brilliant Guzzle library and luckily they came up with functionality to mock up responses. I'll show you how to do it in Symfony.

Continue reading

Using Drush in a MAMP environment

Drush is a very powerful instrument in the toolbox of a Drupal developer. But it can give you a little headache when trying to install in your local MAMP setup. Also because I had forgotten how to do it within my fresh installation of MAMP Pro, a quick and relatively simple tutorial on how to install Drush.

Continue reading

Upgrade MAMP's phpMyAdmin

My current MAMP version ships with phpMyAdmin version 3.3.9.2. But there is already a higher version available, version 3.4.10.1. Upgrading the shipped phpMyAdmin to the latest version appears to be very easy. Just downloading and extracting it to the correct folder.

Continue reading