Seems really obvious when I think about it, but has anyone here written an installer that runs a bunch of unit tests to make sure the thing installed properly? I'm writing a thumbnail generator part of which is a generic image class. One of the unit tests is:
public function testImageFormats() {
$image = new image();
$this->assertEqual($image->gd_support_gif, true);
$this->assertEqual($image->gd_support_png, true);
$this->assertEqual($image->gd_support_jpg, true);
}
When $image is created it gathers some data on what image functionality is available and sets the gd_support values ... if GIF creation isn't supported by the user's version of GD $image->gd_support_gif is false. While that's a useful unit test to check if my image class is working properly exactly the same check would also be a very useful during an installation process.
Has anyone considered taking Simpletest (or another unit test suite) and making an install script out of it?