Re: Unable to run unit tests because PHPUnit_MAIN_METHOD constant is already defined
| From: | Luca Corbo | Date: | Fri, 20 Mar 2009 10:00:43 +0000 |
| Subject: | Re: Unable to run unit tests because PHPUnit_MAIN_METHOD constant is already defined | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51641@lists.php.net to get a copy of this message | ||
> > > > I'm trying to rewrite and execute some old tests wrote for the
> > > > Net_OpenSSH proposal package
> > > > but now I'm unable to run the tests because the PHPUnit_MAIN_METHOD
> > > > constant
> > > >
> > > > is already defined with the "PHPUnit_TextUI_Command::main" value so
> > > > the AllTests::main() in no executed.
> > > Who defines it?
> > >
> > It seems the phpunit executable ...
> >
> > http://www.phpunit.de/browser/phpunit/tags/3.3.15/phpunit.php
>
> You are using phpunit the wrong way.
>
> Either:
> $ php your-test-script.php
> or
> $ phpunit Class_Name
>
I'm already using phpunit as you reported above.
It seems that phpunit since version 3.1.13 defines the PHPUnit_MAIN_METHOD
constant in the phpunit executable, so the method and eventual code in
AllTest::main is not executed, as I have :-P (checking for config.php file
existence).
Except this all work fine so I'm going to remove the check code from
AllTest::main method ;-)
Thanks and regards,
Luca