Unit Testing Custom Code with the Dojo Objective Harness April 15th, 2008 at 10:50 am by Dustin Machi

Many Dojo developers are aware of the Dojo Objective Harness (DOH) that the Dojo Toolkit uses for unit testing. Many people, however, want to use DOH for testing their own code or even non-Dojo code that they have written. While DOH has always supported this, there currently aren’t many examples of doing so. Let’s see if we can help that out.

Out of the box, DOH has supported custom code since the beginning. Tests can include any custom namespaces or code by easily using standard JS techniques. Coming to an understanding of how custom namespaces work with Dojo and how and when DOH loads tests will help us illustrate how you can take advantage of DOH in your own code.

(more…)

Analyze your code, errors, interface, and marketing effectiveness with dojox.analytics March 13th, 2008 at 4:14 pm by Dustin Machi

It’s not very often that I get to work on some software that has the potential to appeal to developers, testers, designers, and the marketing team all at once. And of course when I do get to work on something like that, it usually means there is a significant amount of pressure to get it done and done quickly. My work on dojox.analytics has been one of those rare instances when I’ve been able to work in peace on writing simple and useful code that can entertain a wide variety of use cases.

(more…)

Google AdWords and PHP 5’s Native Soap April 26th, 2007 at 5:48 pm by Dustin Machi

While I’m sure there are plenty of others who have had success ridding themselves of apility, very few places describe how this can be accomplished. I initially found an old post which described the basics of connecting directly to Google AdWords with the native Soap support in PHP. What I needed to create was a very lightweight library for communicating with the various ad networks. I didn’t want to define full class structures for each of the many, many types that the various ad networks have. So I set off to create a simple set of libraries for communicating with each network using PHP 5’s native Soap capabilities.

MSN, no problem…done.

Yahoo, no problem…done.

Google, no proble..err wait almost no problem.

Google went along smoothly as with the other networks until I hit a roadblock. In a few circumstances, Google uses inheritance with their complexTypes. For example, a TextAd is an extension of an Ad. In my simple code, I was creating an associative array with the appropriate structure for a TextAd and sending it off to __soapCall() as the parameter. In this particular case, I noticed (by receiving exceptions from Google) that only the properties that were part of the Ad were being encoded in the Soap envelope. The properties that were specific to TextAd were getting dropped.

After a couple hours of searching and experimentation, I found little that seemed to point me in the correct direction. I had tried to use the SoapVar, but there was very little documentation and fewer examples. However, I finally stumbled upon the relatively simple answer and here I am to document it so that the next poor soul traveling down this path will get there faster than I did.

(more…)