Table of Contents
Test pages
In order to detect broken things, the distribution contains a set of test pages. They are set up with data we know are available on the IMDB sites - so despite the fact that things may be updated, we at least know we can expect some response here. These tests are located in the test/ subdirectory of the distribution, and you usually can simply point your browser to that directories URL (you may have to add index.php to the URL if you get an error about directory browsing not being allowed). Now the available methods should list up and be marked with either a green "PASS" or a red "FAIL" - and you should know what is broken.
Make sure whether caching is involved
To figure out what the cache could have to do with it, simply add ?cache=off to the end of the URL to turn it off - or ?cache=on to force it being used.
Limiting tests to sections
It is also possible to only check a given part of the API: ?check=movie restricts the run to the movie methods, while ?check=name restricts it to the person methods. Alternatively you may decide to test all but a few sections: ?skip=movie,trail would do this for the corresponding classes. Of course you can combine these with the cache advisor, e.g. with ?check=movie;cache=off or ?check=name&cache=on. Just use the delimiter your PHP installation understands (you may have noticed one example using the ";" while the other uses "&"). Available "restrictors" include:
| Value | Description |
|---|---|
| movie | methods from the main class (movie methods) |
| name | methods from the imdb_person class |
| charts | methods of the imdb_topcharts class |
| nowplay | methods of the imdb_nowplaying class |
| trail | methods of the imdb_trailers class |
Cron-Mode
For automated tests, a "Cron-Mode" is available specifying ?cron=1 at the URL. Doing so advices the test pages to keep quiet as long as no failures happen (i.e. don't report progress) - and to report failures, if any, as plain text only. This enables you to set up a cron task to inform you as soon as something gets broken (usually due to design changes at the IMDB sites), defining e.g. the command wget -q -O - http://your.server.dom/imdb/test/?cron=1 for it (if you do so, please point it to your own installation only, and not to the projects servers!). Since this way no output is generated unless errors occur, Cron would send you a message only then.
URL parameter summary
For your convenience, here comes a summary of available URL parameters for the test suite:
| Name | Value | Description |
|---|---|---|
| cache | 0/off/false, 1/on/true | Forces the caching to be turned off/on, regardless of what the classes configuration says |
| check | movie/name/charts/nowplay/trail | Run the test on the specified class only, exclude everything else (you may only specify one of the values) |
| cron | 1 | Switch on Cron-mode (always off by default) |
| skip | comma-separated list of check options | Run all tests except those specified here. To exclude more than one class, use comma-separated values, e.g. skip=movie,trail |
