Re: writing tests
| From: | zoe | Date: | Fri, 17 Oct 2008 17:16:19 +0000 |
| Subject: | Re: writing tests | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64463@lists.php.net to get a copy of this message | ||
till wrote:
Aloha, wanted to ask who would be up to give me some feedback on tests and where would I submit them in the end? Since I am not the uber-leet hacker (someone mentioned on http://qa.php.net), I thought I could help out in another way. Here would be my first: http://www.friendpaste.com/wqds2cg3Hi - I had a quick look. This behaviour is currently wrong in PHP52 and right in PHP53 and PHP6. It would be a good test if it showed the intended behaviour, because it seems to me to be non-obvious. In the test you are also relying on someone having set a TZ environmental variable, which I hadn't, so you should use an --INI-- section. So, here is the test after my modifications: --TEST-- strtotime() function - a test to show the difference in behaviour between 'first' and '1' --INI-- date.timezone="Europe/London" --SKIPIF-- <?php if (!function_exists('strtotime')) echo "SKIP"; ?> --FILE-- <?php var_dump(date('Y-m-d', strtotime('first Monday December 2008'))); var_dump(date('Y-m-d', strtotime('1 Monday December 2008'))); ?> --EXPECT-- string(10) "2008-12-08" string(10) "2008-12-01" Would you run it and let me know if you agree with the changes? In general sending tests to this list is the best place to start.
Cheers and have a great weekend, Till