Re: How to EXPECT _error
| From: | Hannes Magnusson | Date: | Wed, 08 Apr 2009 09:21:03 +0000 |
| Subject: | Re: How to EXPECT _error | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64745@lists.php.net to get a copy of this message | ||
On Tue, Apr 7, 2009 at 22:53, Àlex Corretgé <alex@corretge.cat> wrote:
> Hi, I'm confused to write _error .phpt.
>
>
> http://testfest.php.net/repos/testfest/CataloniaUG/tests/func/time_nanosleep_error1.phpt
>
> I write a wrong instruction in the --FILE-- section :
>
> $nano = time_nanosleep('A', 100000);
>
>
> And in the --EXPECT-- section I put the Warning message
>
> Warning: time_nanosleep() expects parameter 1 to be long, string given
>
> Is this correct?
run-tests.php splits the .phpt files into multiple files (skipif, the
test it self, expected output...), so the actual executed test name is
called <testname>.php, not .phpt.
When testing errormessages you will therefore have to match against
%stestfilename.php, not .phpt :)
-Hannes