[UPHPU] Regression testing of builtin functions

Walt Haas haas at xmission.com
Fri Nov 11 18:21:20 MST 2005


Cool, thanks!

-- Walt

"Snyder Family" <astrozon78 at comcast.net> wrote:

> Walt,
> 
> Today I actually ran into the PECL function override_function which you can
> install through pear with "pear install apd".  See
> http://us2.php.net/manual/en/function.override-function.php and
> http://us2.php.net/manual/en/ref.apd.php.
> 
> 
> Ken Snyder
> 
> -----Original Message-----
> From: uphpu-bounces at uphpu.org [mailto:uphpu-bounces at uphpu.org] On Behalf Of
> Walt Haas
> Sent: Friday, November 11, 2005 4:35 PM
> To: uphpu at uphpu.org
> Subject: [UPHPU] Regression testing of builtin functions
> 
> One of the things I need to do in regression testing is test my code
> with various returns from builtin functions like date().  So for
> example if my code is supposed to do one thing on one date and
> something else on another date, I need to be able to make date()
> return those two values during the test.
> 
> In a compiled language with runtime libraries, say C or C++,
> I could test by substituting my own version of date() in front of the
> standard version, and so control the return.  I haven't figured out a
> way to do that in PHP yet, so have resorted to defining a wrapper, have
> my code call the wrapper and have the wrapper return either the right
> value or the appropriate test value.
> 
> Do you know of any way to substitute a test version of a function like
> date() that would eliminate the need for the wrapper?
> 
> TIA  -- Walt
> -------
> Walt Haas          The Website Doctor - Cures Sick Websites
> (801) 534-1262     http://thewebsitedoctor.net
> 
> _______________________________________________
> 
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.12.8/166 - Release Date: 11/10/2005
>  
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.12.8/166 - Release Date: 11/10/2005
>  
> 
> 
> _______________________________________________
> 
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net


-------
Walt Haas          The Web Site Doctor - Cures Sick Web Sites
(801) 534-1262     http://thewebsitedoctor.net



More information about the UPHPU mailing list