Code Comments
Programming Forum and web based access to our favorite programming groups.Greg Beaver wrote: > this division is not accurate. I would put it > > 1) PHPUnit and Simpletest can only be used to test classes and functions I agree, no public method should be released without couple unit testing > 2) .phpt can be used to test anything that PHP can be used for. What I like too. This way coding the test enable any test you like to do and repeat. > > Some packages simply can't be easily regression-tested by all users. Could never be required > Generally, apps that absolutely require complex external interfaces > like DB or MDB will always require some external setup by the tester. > Packages like Net_Curl, for instance, require that an external server > be set up over the internet - Indeed they need to be tired and hazarded. > it's literally impossible to test its functionality without this step. Again, I'm ok, better shock your app on your own > > > I agree with the "I aim" part, but have no idea what you are talking > about in the rest of the paragraph, could you rephrase? Let have a script.php, requiring some variables, say in $_POST for this script.php, I can build some real value tests unit or whole apps with PHPUnit and Simpletest But I need to build it. I would like to turn a key as I am testing this script.php (perhaps then over HTTP) what would then record the testing (recording the $_POST in the session) Someway, somehow that recording will stop I like to have this record generating me some PHPUnit or .phpt scripts So puting the $_POST recorded as php script initializing variables. > > again, what are you trying to say? A lot is server/client what is all cases server/clientS and at most serverS/clientS PHPUnit and .phpt have no 'S' and no 'S''S' (one to one) It's due to test with, let say, "overcrossing clients"... then best simulate less or more stochastic requests When testing a pckg, some third party exists, what pear not necessarly controls, but interaction is dynamic, so we need to test it (so as no control from pear, simulate) > > Are you talking about mock objects? If you want to use mock objects, > it's no harder to do this with PHPUnit2, Simpletest, or simply by > writing them yourself. I wrote several mock objects for PEAR's unit > tests, including an object that literally simulates the entire PEARweb > without using the internet. It didn't take long, but it did take work. > > Greg > Sure these mock objects are good to use. But they transform the script, don't they? Where is the definition for mock objects, or some examples ? From my point of view, simulation should come from outer, as far as possible script not knowing it's simulation. Ã_+ bertrand Gugger (toggg)
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.