Re: PHPUnit tests that access a remote server

From: Date: Wed, 21 Nov 2007 19:51:05 +0000
Subject: Re: PHPUnit tests that access a remote server
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-48563@lists.php.net to get a copy of this message
kOn 11/21/07, Christian Weiske <cweiske@cweiske.de> wrote: > > Jorrit, > > > > I am in the process of fixing bugs in Net_FTP and I would like to > > write some phpUnit tests along with them. For testing Net_FTP's > > functionality, it is necessary to have a connection to an FTP server > > that allows writing. How should such be accomplished in a test? For > > myself I use a private FTP server, but is it allowed to require > > others to first fill in their FTP connection details prior to using > > the test? > > The best way is to distribute a config.php.dist file that the users > need to copy to config.php and adjust the settings in there. if the > file is missing, skip the tests. Requiring an external resource is not uncommon, you need an ftp server to test this package, that's legit, MDB2 needs a database, etc :) Do what Christian said and everyone will be happy, you can even do something similar to MDB2, kinda like a status file where you list couple of FTP servers you test with or you ask some other people to test and so you can have a list of common ftp servers and what works with them. A crude example: Read | Write | Upload FTP server v1 X X X FTP server v2 X X and so on, look at the mdb2 CVS docs dir for a proper example :P Regards Helgi

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