Re: Writing new test for #46196
| From: | Felix De Vliegher | Date: | Fri, 31 Oct 2008 18:42:04 +0000 |
| Subject: | Re: Writing new test for #46196 | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64498@lists.php.net to get a copy of this message | ||
Hello Olivier
On first view your reproduce code is looking ok, but try to use the format as explained on http://qa.php.net/write-test.php
Notice the different parts of a full testcase, including:
--TEST-- (description of the test case)
--CREDITS-- (appropriate credits, optional)
--XFAIL-- (expected fail, until bug #46196 is fixed, optional but advised here)
--FILE-- (the actual test)
--EXPECT-- (the expected output)
In your case, this could be (file restore_error_handler_bug46196.phpt):
--TEST--
Test restore_error_handler() function : bug #46196
--CREDITS--
Olivier Doucet
--XFAIL--
This test will fail until bug #46196 is fixed
--FILE--
<?php
/* Prototype : void restore_error_handler(void)
* Description: Restores the previously defined error handler function
* Source code: Zend/zend_builtin_functions.c
* Alias to functions:
*/
echo "*** Testing restore_error_handler() : bug #46196 ***\n";
var_dump( set_error_handler( 'myErrorHandler' ) );
var_dump( restore_error_handler() );
var_dump( set_error_handler( 'myErrorHandler' ) );
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
return true;} ?> ===DONE=== --EXPECT-- *** Testing restore_error_handler() : bug #46196 *** NULL bool(true) NULL ===DONE=== You can always post other test cases on this mailing list if you want them to be reviewed, or have a look on irc (server irc.freenode.net) on channel #phptestfest. Thanks for looking into testing! Kind regards, Felix Op 31-okt-08, om 18:57 heeft Olivier Doucet het volgende geschreven:
Hi everyone, This is my first attempt to write a php test. I read on http://qa.php.net/write-test.php that you won't bite ;) This is a test for bug #46196 (http://bugs.php.net/bug.php?id=46196). Feel free to give me any feedback on it. I tested it successfully on PHP 5.2.3 and PHP 5.2.7RC2. Thank you Olivier --PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php