Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.0

Request #11867 Improve tests for fetching from Cache
Submitted: 2007-08-19 18:30 UTC
From: hgschulz Assigned: doconnor
Status: Assigned Package: Services_ExchangeRates (version 0.5.3)
PHP Version: 5.2.3 OS: Centos
Roadmaps: (Not assigned)    
Subscription  


 [2007-08-19 18:30 UTC] hgschulz (Henning Schulzrinne)
Description: ------------ The library currently uses protected class members to test if their is old data available. This can fail under some conditions, i.e., the test if (isset($cache->_file) && file_exists($cache->_file)) { returns true, but if ($data = $cache->get($cacheID, 'default', true)) fails later. A more reliable, albeit slightly less efficient, method is to use the real cache->get test before attempting the conditional HTTP GET.

Comments

 [2008-12-28 16:36 UTC] doconnor (Daniel O'Connor)
Henning, want to take a look at the CVS version? I've done some pretty major refactoring to get unit tests, etc up and running - there's now a concept of 'transport' classes which you can swap in and out. If you wanted to write unit tests against Services_ExchangeRates_Transport_HTTP_Cached that owuld be really handy.