Re: Testing PEAR Packages

From: Date: Fri, 22 Oct 2004 16:39:27 +0000
Subject: Re: Testing PEAR Packages
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34033@lists.php.net to get a copy of this message
Jon Wood wrote:
Hey, I'm trying to write test suites for some packages at the moment, and wondered if anybody knows of a way to make them easier to use than currently. I'm using PHPUnit2, and have the problem of not being able to run my tests without building and installing a new version of the package first, due to "require_once("Package/Component.php");" calls which require the code to be in the include_path. I'm sure I could hack together a quick script which sets the include_path before running the test suite, but I'd rather know if there's a less hackish solution to the problem.
The best way to test a PEAR package is to have an updated package.xml and test it from the install dir - things will always act differently. Creating the first package.xml can be a pain, but just use PEAR_PackageFileManager to make a quick one for you, and then make it real when the time is right. A quick pear install --force package.xml always does the trick for me (this is how I test the PEAR installer). When things crap out, I copy the offending file and reinstall. Greg

« previous php.pear.dev (#34033) next »