1717require_once 'bootstrap.php ' ;
1818require_once 'Google/Client.php ' ;
1919
20- class BaseTest extends PHPUnit_Framework_TestCase {
20+ class BaseTest extends PHPUnit_Framework_TestCase
21+ {
2122 const KEY = "" ;
2223 private $ token ;
2324 private $ memcacheHost ;
@@ -26,36 +27,38 @@ class BaseTest extends PHPUnit_Framework_TestCase {
2627 public function __construct ()
2728 {
2829 parent ::__construct ();
29- // Fill in a token JSON here and you can test the oauth token
30+ // Fill in a token JSON here and you can test the oauth token
3031 // requiring functions.
3132 // $this->token = '';
3233
3334 $ this ->memcacheHost = getenv ('MEMCACHE_HOST ' ) ? getenv ('MEMCACHE_HOST ' ) : null ;
3435 $ this ->memcachePort = getenv ('MEMCACHE_PORT ' ) ? getenv ('MEMCACHE_PORT ' ) : null ;
3536 }
3637
37- public function getClient () {
38- $ client = new Google_Client ();
39- $ client ->setDeveloperKey (self ::KEY );
40- if (strlen ($ this ->token )) {
41- $ client ->setAccessToken ($ this ->token );
42- }
43- if (strlen ($ this ->memcacheHost )) {
44- $ client ->setClassConfig ('Google_Cache_Memcache ' , 'host ' , $ this ->memcacheHost );
45- $ client ->setClassConfig ('Google_Cache_Memcache ' , 'port ' , $ this ->memcachePort );
46- }
47- return $ client ;
38+ public function getClient ()
39+ {
40+ $ client = new Google_Client ();
41+ $ client ->setDeveloperKey (self ::KEY );
42+ if (strlen ($ this ->token )) {
43+ $ client ->setAccessToken ($ this ->token );
44+ }
45+ if (strlen ($ this ->memcacheHost )) {
46+ $ client ->setClassConfig ('Google_Cache_Memcache ' , 'host ' , $ this ->memcacheHost );
47+ $ client ->setClassConfig ('Google_Cache_Memcache ' , 'port ' , $ this ->memcachePort );
48+ }
49+ return $ client ;
4850 }
4951
5052 public function testClientConstructor ()
5153 {
5254 $ this ->assertInstanceOf ('Google_Client ' , $ this ->getClient ());
5355 }
5456
55- public function testIncludes () {
57+ public function testIncludes ()
58+ {
5659 $ prefix = dirname (dirname (__FILE__ )) . '/src/ ' ;
5760 $ path = dirname (dirname (__FILE__ )) . '/src/Google/Service ' ;
58- foreach (glob ($ path . "/*.php " ) as $ file ) {
61+ foreach (glob ($ path . "/*.php " ) as $ file ) {
5962 // Munge prefix so we don't double require.
6063 $ this ->assertEquals (1 , require_once (str_replace ($ prefix , '' , $ file )));
6164 }
@@ -69,5 +72,4 @@ public function checkToken()
6972 }
7073 return true ;
7174 }
72-
7375}
0 commit comments