Sorry for spamming but I didn't mean to reply you privately :( On 11/1/05, Jochem Maas <jochem@xxxxxxxxxxxxx> wrote: > > Manish Marathe wrote: > > Hello All, > > > > I am developing a unit test generator for PHP. The generated tests would > be > > PHPUnit2 compatible and I will be using the Reflection API to generate > the > > tests. The tests would be generated only for classes and written on PHP > > 5.0.3 compatible. > > > > My question is to use the Reflection API, I need to import the original > > class for which I am generating tests. For example to generate a tests > for > > class Company which is in Company.php: > > > > include_once('company.php'); > > > > $c = new ReflectionClass('Company'); > > > > If I have to generate test for many classes at once, it would be foolish > to > > have them included in my file on the runtime. Am I understanding it > > a complex app can have 100's of classes, not usually all loaded at once > but still. > > the upper limit is depends on how much memory your generation process is > allowed > to grow to, how often you [need to] run it, how process-intensive it is to > run > the generation and how big your iron is. Well, its not me who is going to run the unit tests but it the user who is going to. As I said I am developing an automatic unit test "generator", which will generate tests for the user and then the user can run them. So its totally upto the user to decide how many classes to load, how frequently to load them. you might consider using forking in a master process and letting a series of > child processes each handle a chunk of all the classes to generate tests > for, > basically running in parallel. > > I don't see how you can avoid loading many classes 'at once', why do you > think this is foolish [by definition]? > I am sorry if I have hurted anyone's feelings here but by foolish simply I was pointing to the same problem you stated which is of allocating the memory and which I definitely foresee. Thank You any way, forking should help but my problem was, I guess I didn't explain it well but to use the ReflectionClass like above I have to include the class file into my script. Is it possible to keep all the class files somewhere in the path where PHP can look for and I don't have to include in my script. Manish Marathe SpikeSource, Inc. http://developer.spikesource.com