File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2323abstract class BaseTestCase extends \PHPUnit_Framework_TestCase
2424{
2525 /**
26- * Get a real HTTP client. If $_SERVER['RESPONSE_CACHE'] is set to a path it will use cached responses.
26+ * @return string|null the directory where cached responses are stored
27+ */
28+ abstract protected function getCacheDir ();
29+
30+ /**
31+ * Get a real HTTP client. If a cache dir is set to a path it will use cached responses.
2732 *
2833 * @return HttpClient
2934 */
3035 protected function getHttpClient ($ apiKey = null )
3136 {
32- if (isset ( $ _SERVER [ ' RESPONSE_CACHE ' ]) && false !== $ _SERVER [ ' RESPONSE_CACHE ' ] ) {
33- return new CachedResponseClient (new HttplugClient (), $ _SERVER [ ' RESPONSE_CACHE ' ] , $ apiKey );
37+ if (null !== $ cacheDir = $ this -> getCacheDir () ) {
38+ return new CachedResponseClient (new HttplugClient (), $ cacheDir , $ apiKey );
3439 } else {
3540 return new HttplugClient ();
3641 }
You can’t perform that action at this time.
0 commit comments