timeoffset per process

From: Date: Wed, 09 Feb 2005 20:38:10 +0000
Subject: timeoffset per process
Groups: php.internals 
Request: Send a blank email to internals+get-14772@lists.php.net to get a copy of this message
Hi, I am currently writing test cases for time sensitive code. Meaning this code behaves different depending on the time of day. Obviously one solution is to mess with the server time, but that is going to screw up anything else going on the server. The only solution that I have currently come up with requires alot of uglyness by making my code call a wrapper function instead of time() or date() which optionally adds an offset to the time that can be set before executing the tests. It seems like a minor feature to add to the date extension. But then again I can understand that Derick doesnt feel features for testing fits into the new date extension. Am I missing an obvious alternative? Is there a better place to add this feature? regards, Lukas

« previous php.internals (#14772) next »