Drupal Schema API has problems
An interesting post from Lullabot today on problems with Drupal’s Schema API and the Twitpocalypse
It turns out that the Schema API doesn’t properly understand the difference between different types of integers
Technical information on this site may be out of date : no updates since 2015
An interesting post from Lullabot today on problems with Drupal’s Schema API and the Twitpocalypse
It turns out that the Schema API doesn’t properly understand the difference between different types of integers
I had fun this weekend at the PHP London Test Fest, it was a great opportunity to learn something new and meet some great programmers.
The tests our team took on were based around the SPLiterators I hadn’t used this part of PHP before and it was a great way to learn about it, especially as many of the functions we tested aren’t documented yet.
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:
Oh cool :-)
I just noticed that selenium IDE has the option to export tests as PHP unit tests.
As well as following standards such as those laid down by www.w3.org I always try and test websites I develop across a range of browsers. Despite improvements in compatibility in recent years, browsers do still vary in implementation and even relatively minor browsers are still used by large numbers of people.
However all this testing can be hard to keep on top of and sometimes I just have to push out what seems like a small code change with only limited testing.
I’m aiming to automate as much testing as possible, this is a little more work up front - but makes re-running tests trivial and so more likely to happen.
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
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.
I just came across this http://zoomsplatter.blogspot.com/2009/01/so-phar-so-good.html
In that same way that you can package up a java application into a single archive file (a jar) and run it directly from that file - you can now create a php archive file (a phar) !
I came across this PDF slideshow from a talk on optimising PHP, it’s well balanced and fairly thorough overview.
The selected file could not be uploaded, because the destination is not properly configured
This “feature” has bitten me before. It’s one of those annoying Drupal things which would be fine if the error message wasn’t so misleading.
What’s happening is that file_copy()
calls file_create_path()