Re: [PEPr] +1 for Testing::Testing_FIT
| From: | Gregory Beaver | Date: | Mon, 11 Jun 2007 21:45:44 +0000 |
| Subject: | Re: [PEPr] +1 for Testing::Testing_FIT | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47029@lists.php.net to get a copy of this message | ||
gERD Schaufelberger wrote:
> Hi Greg, Hi Stephan
>
>>>> be sure to add the file Testing/FIT.php prior to the first
>>>> release, so that there is a clear starting point.
>>> What should this file contain? There is no need for this file.
>> It should be the starting point. Users who wish to use Testing/FIT
>> should be able to:
>
> You are both right.
>
>> <?php
>> require_once 'Testing/FIT.php';
>> ?>
>
> Something like this would be a good starting point. Still - as Stephan
> said - I have no clue what should be there? The basic fixture? The
> runner?
>
> From my point of view, both seems to be wrong. When you write test, you
> usually derive from one or the other fixture. Putting the runner to
> Testing/FIT.php does not make sense either: "Surfing" to
> Testing/FIT.php is not possible (at least in a serious installation),
> running Testing/FIT.php from CLI looks funny, too.
>
> Actually, I have no idea :-)
For the record, my vote was not conditional, but I do think providing
something as a starting point is a good idea.
I think putting the runner in Testing_FIT is actually the best choice.
Your example code goes from:
<?php
include_once 'Testing/FIT/Runner.php';
$fr = new Testing_FIT_Runner();
$fr->run( $in, '-' );
?>
to
<?php
include_once 'Testing/FIT.php';
$fr = new Testing_FIT();
$fr->run( $in, '-' );
?>
or
<?php
include_once 'Testing/FIT/Runner.php';
$result = Testing_FIT_Runner::main( $_SERVER['argv'] );
exit( $result );
?>
to
<?php
include_once 'Testing/FIT.php';
$result = Testing_FIT::main( $_SERVER['argv'] );
exit( $result );
?>
This is far more intuitive than knowing that "Runner.php" is the main
class you need to run the test suite.
In the end, it's up to you, just take my advice as non-binding advice
from an outsider who would find this useful.
Greg