Re: Re: Automated testing
| From: | Stefan Neufeind | Date: | Tue, 07 Oct 2003 06:49:54 +0000 |
| Subject: | Re: Re: Automated testing | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22431@lists.php.net to get a copy of this message | ||
On 7 Oct 2003 at 4:48, Tomas V.V.Cox wrote:
> Tuesday, October 7, 2003, 1:00:06 AM, Stefan Neufeind wrote:
>
> > On 6 Oct 2003 at 15:58, Tomas V.V.Cox wrote:
>
> >> Keith Edmunds wrote:
> >> > Has anyone done any work on automated testing of PHP/PEAR
> >> > applications? It seems much harder to write a test suite for
> >> > interactive applications than traditional data processing
> >> > applications, and I'd be interested in hearing about any
> >> > approaches that have been used.
> >> >
> >>
> >> Currently we're using the php test suite, integrated in the pear
> >> command as "pear run-tests <file>.phpt". Read more about it at:
> >> http://qa.php.net/write-test.php
>
> > Hmm - has there been a decision for an "official" way to do it? Now
> > I hear about phpt, several times in the past PHPUnit-tests were
> > mentioned ...
>
> > And what's even more interesting for me: How should I test functions
> > that don't have real "return values" but modify a state of an object
> > or of a file? E.g. many functions of class DB or MP3-tagging (ID3)
> > of a file. Any proposal for unit-tests under those circumstances?
>
> PHP Tests doesn't conflict with PHPUnit tests, even more, they are
> supplementary. PHP Tests compares expected output from the test with
> the actual output, very simple for creating them and very simple for
> running them (pear run-tests). We do use PHP tests for PEAR DB and
> can't see any problem on using them for MP3-tagging. Read the url I
> posted.
Yes, already hat a look on that page. It's easy to work with
functions like strstr and similar that are mentioned in the examples -
agreed. But I meant how do you check functions that don't have
return-values and just manipulate details in the object instance or a
file? Then you can just do some modifications (maybe to a file), call
a read-function for the file and afterwards compare this with your
expected results, right? I just meant that you can't make sure that
every function works well or diagnose in which particular function
something went wrong.
Stefan