Re: writing tests
| From: | zoe | Date: | Fri, 17 Oct 2008 19:06:30 +0000 |
| Subject: | Re: writing tests | ||
| References: | 1 2 3 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64465@lists.php.net to get a copy of this message | ||
till wrote:
On Fri, Oct 17, 2008 at 7:16 PM, zoe <zoe.slattery@googlemail.com> wrote:I am not sure... :-) "first" and "1" should both output 2008-12-01. But neither does - at least on 5.2.6. I remember that Scott helped me last night on IRC and I think the only he found working was 5.3-alpha3-dev (or similar :-)). I probably didn't write enough in my first email, but the problem is that "first" and "1" both fail. I was more concerned about "first" though - but testing both in one is perfectly fine. I'm not an expert in this area - but I asked Derick (who is). If I understood him correctly the test that I sent shows the expected behaviour. I ran it on PHP52 (checkout from today), PHP53 (recent checkout) on and, with some mods, on PHP6. The test passed on PHP53 and PHP6 but failed on PHP52. I'm copying Derick and Scott - I may have misunderstood, so it would be good to sort out.till wrote:Hi - 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?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/wqds2cg3Aloha,
In general sending tests to this list is the best place to start.OK, great. Till