Technical information on this site may be out of date : no updates since 2015

Drupal and TinyMCE

July 7, 2009 , posted under drupal javascript tinymce jquery

I’ve been working on a Drupal project to build a CMS for the production and management of very specific content.

The emphasis is all on the backend system, with tight field size limits (character count including markup) and restricted input (specified tags only).

Because of this I needed to use TinyMCE fully - restricting the valid_elements set, and adding event handlers for paste, and keyup.

Read More…

simpletest vs phpunit

May 6, 2009 , posted under php drupal testing

There are two main options for unit testing PHP: simpletest and phpunit

They both do a lot of the same stuff, both have the ability to run suites of tests and create mock objects.

Simpletest has a built in webTestCase which allows you to perform some integration as well as unit testing.

An example web test for simpletest is:

Read More…

Continuous Integration Testing for Drupal with CruiseControl (part 1)

April 8, 2009 , posted under php drupal testing svn cruisecontrol unit testing agile phpundercontrol

I recently finished work on a project that really suffered from a lack of build tools.

It was a large project, and while many of us were keen on writing tests we weren’t able to get management sign of to spend some time automating the test process. So even though we did some of the work we didn’t get all the benefits.

It was really frustrating to come back to a piece of work that was well covered by unit tests, only to find those tests broken

Read More…

version control with Git

April 2, 2009 , posted under drupal svn git

I’ve been intrigued by git for a while, but as a long time user of svn I’m kinda cautious about moving on.

So today I had some time and used it to read up on the pros and cons, as well as try things out a bit.

It seems to me that git is clearly the better system; but that svn has the advantage of maturity.

Read More…

Using Exceptions in PHP

March 26, 2009 , posted under php drupal

The Drupal project I’ve been working on for the last year involved some fairly heavy file processing, with lot’s of validation.

To simplify the code I made extensive use of Exceptions, I didn’t create that many different Exception classes - but I made sure that any errors which affect the flow of the logic were handled by Exceptions.

Read More…