Re: cvs: php-src /ext/phar/phar pharcommand.inc
| From: | Greg Beaver | Date: | Fri, 05 Jun 2009 19:47:08 +0000 |
| Subject: | Re: cvs: php-src /ext/phar/phar pharcommand.inc | ||
| References: | 1 2 3 4 5 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-65072@lists.php.net to get a copy of this message | ||
Hannes Magnusson wrote:
> (Moving to QA)
>
> On Fri, Jun 5, 2009 at 17:38, Greg Beaver<greg@chiaraquartet.net> wrote:
>
>> Hannes Magnusson wrote:
>>
>>> On Thu, Jun 4, 2009 at 14:31, Hannes Magnusson<bjori@php.net> wrote:
>>>
>>>
>>>> On Thu, Jun 4, 2009 at 14:21, Hannes Magnusson <bjori@php.net> wrote:
>>>>
>>>>
>>>>> bjori Thu Jun 4 12:21:59 2009 UTC
>>>>>
>>>>> Modified files:
>>>>> /php-src/ext/phar/phar pharcommand.inc
>>>>> Log:
>>>>> Fixed creating directory structure when extracting phars
>>>>>
>>>>>
>>>> So I am a bit confused here, are there tests for these PHP files?
>>>> Should there be?
>>>>
>> I may have time to do the tests, but that is also tenuous, so if there
>> is a testfester who would like to tackle these, it would be greatly
>> appreciated.
>>
>
> What would be the best way of writing test for the command?
>
> The build process in it self is a bit confusing, it seemingly copies
> the files from ext/phar/phar to ext/phar and then bundles them into
> phar.phar.. So I guess testing phar.phar should be enough.
>
> Faking $argc and $argv and include "phar.phar" would maybe do the trick?
Hi,
Yes, this is the best way, I've used that technique many times to test
the frontend for Pyrus. The build process will simply fail at build
time if it isn't working, and is a lot easier to debug. There's only 1
execution path, so the act of running "make" is a 100% code coverage
unit test :). What needs testing is the finished phar.phar.
Greg