Re: The new run-tests.php...
| From: | Georg Gradwohl | Date: | Fri, 03 Jul 2009 12:10:30 +0000 |
| Subject: | Re: The new run-tests.php... | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-65177@lists.php.net to get a copy of this message | ||
Am 03.07.09 10:11 schrieb "Ulf Wendel" unter <Ulf.Wendel@Sun.COM>:
> zoe schrieb:
>>> PHP 6: works in general
>>>
>>> In general you can use run-tests.php with PHP 6. --help and other
>>> options cause an error. Plain vanilla test runs work fine.
>>>
>>> Catchable fatal error: Method Exception::__toString() must return a
>>> string value in /home/nixnutz/src/phpruntests/src/run-tests.php on
>>> line 16
>>>
>
> Oh, easy. PHP6 wants you to use "print $e->getMessage()" instead of
> "print $e". I am not familiar enough with the PHP syntax to judge if
> that is a PHP 6 issue or a valid PHP 6 syntax change.
>
>
> nixnutz@ulflinux:~/src/phpruntests>
> /home/nixnutz/src/login/php6/sapi/cli/php -r ' $e = new
> Exception("foo"); print $e;'
>
> Catchable fatal error: Method Exception::__toString() must return a
> string value in Command line code on line 1
>
> nixnutz@ulflinux:~/src/phpruntests>
> /home/nixnutz/src/login/php5/sapi/cli/php -r ' $e = new
> Exception("foo"); print $e;'
> exception 'Exception' with message 'foo' in Command line code:1
> Stack trace:
> #0 {main}
In this case we use our own exception-class (rtException) which has a
__toString-method implemented. So "print $e" should work for this, or rather
does work with php5.
However, I'll have a look at it - thanks for your feedback!
g2
> Another detail about handling options with PHP 6. When I do
> "run-tests.php --help test.phpt" it will run the test but not print the
> help message. With PHP 5.3 its the other way around, which meets my
> expectations. With PHP 5.3 you get the help message but the test won't
> be run.
>
> But hey, you said already, run-tests.php has not been ported/tested to
> PHP 6 yet...
>
> Ulf