File tree Expand file tree Collapse file tree 2 files changed +1
-29
lines changed
Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -929,25 +929,9 @@ public function setCache(CacheInterface $cache)
929929 */
930930 public function getCache ()
931931 {
932- if (!isset ($ this ->cache )) {
933- $ this ->cache = $ this ->createDefaultCache ();
934- }
935-
936932 return $ this ->cache ;
937933 }
938934
939- protected function createDefaultCache ()
940- {
941- if ($ this ->isAppEngine ()) {
942- $ cache = new Google_Cache_Memcache ();
943- } else {
944- $ cacheDir = sys_get_temp_dir () . '/google-api-php-client ' ;
945- $ cache = new Google_Cache_File ($ cacheDir );
946- }
947-
948- return $ cache ;
949- }
950-
951935 /**
952936 * Set the Logger object
953937 * @param Psr\Log\LoggerInterface $logger
Original file line number Diff line number Diff line change @@ -254,6 +254,7 @@ public function testSettersGetters()
254254
255255 $ client ->setRedirectUri ('localhost ' );
256256 $ client ->setConfig ('application_name ' , 'me ' );
257+ $ client ->setCache (new Google_Cache_Null ());
257258 $ this ->assertEquals ('object ' , gettype ($ client ->getCache ()));
258259
259260 try {
@@ -268,19 +269,6 @@ public function testSettersGetters()
268269 $ this ->assertEquals ($ token , $ client ->getAccessToken ());
269270 }
270271
271- /**
272- * @requires extension Memcached
273- */
274- public function testAppEngineMemcacheConfig ()
275- {
276- $ _SERVER ['SERVER_SOFTWARE ' ] = 'Google App Engine ' ;
277- $ client = new Google_Client ();
278-
279- $ this ->assertInstanceOf ('Google_Cache_Memcache ' , $ client ->getCache ());
280-
281- unset($ _SERVER ['SERVER_SOFTWARE ' ]);
282- }
283-
284272 public function testAppEngineStreamHandlerConfig ()
285273 {
286274 $ this ->onlyGuzzle5 ();
You can’t perform that action at this time.
0 commit comments